[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vl: Add opts to device opts list when using JSON syntax for
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] vl: Add opts to device opts list when using JSON syntax for -device |
Date: |
Tue, 21 Dec 2021 09:25:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
Cc'ing Markus.
On 12/20/21 09:45, MkfsSion wrote:
> When using JSON syntax for -device, -set option can not find device
> specified in JSON by id field. The following commandline is an example:
>
> $ qemu-system-x86_64 -device '{"id":"foo"}' -set device.foo.bar=1
> qemu-system-x86_64: -set device.foo.bar=1: there is no device "foo" defined
>
> The patch adds device opts to device opts list when a device opts get
> parsed.
>
> Signed-off-by: MkfsSion <mkfssion@mkfssion.com>
BTW per:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#patch-emails-must-include-a-signed-off-by-line
"Please use your real name to sign a patch (not an alias or acronym)."
> ---
> softmmu/vl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 620a1f1367..0dd5acbc1a 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3400,6 +3400,8 @@ void qemu_init(int argc, char **argv, char **envp)
> loc_save(&opt->loc);
> assert(opt->opts != NULL);
> QTAILQ_INSERT_TAIL(&device_opts, opt, next);
> + qemu_opts_from_qdict(qemu_find_opts_err("device",
> &error_fatal),
> + opt->opts, &error_fatal);
> } else {
> if (!qemu_opts_parse_noisily(qemu_find_opts("device"),
> optarg, true)) {