From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: "Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [RFC PATCH-for-6.2 v3] qdev-monitor: Only allow full --global <driver>.<property>=<val> option
Date: Fri, 19 Nov 2021 20:07:23 +0100 [thread overview]
Message-ID: <23766d94-96da-d2c7-eb12-2e830e178d0c@redhat.com> (raw)
In-Reply-To: <a83d167f-60b8-6991-2f5-ab6ab8a6beac@eik.bme.hu>
On 11/19/21 19:46, BALATON Zoltan wrote:
> On Fri, 19 Nov 2021, Philippe Mathieu-Daudé wrote:
>> When not all fields of the --global option are provided,
>> QEMU might crash:
>>
>> $ qemu-system-x86_64 -global driver=isa-fdc
>> qemu-system-x86_64: ../../devel/qemu/qapi/string-input-visitor.c:394:
>> string_input_visitor_new: Assertion `str' failed.
>> Aborted (core dumped)
>>
>> Fix by only allowing --global with all 3 fields:
>>
>> $ qemu-system-x86_64 -global driver=isa-fdc
>> Invalid 'global' option format. It must be provided as:
>> --global <driver>.<property>=<value>
>>
>> Reported-by: Thomas Huth <thuth@redhat.com>
>> Suggested-by: Markus Armbruster <armbru@redhat.com>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/604
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> v3: Change qemu_global_option (Markus)
>>
>> Supersedes: <20211119122911.365036-1-philmd@redhat.com>
>> ---
>> softmmu/qdev-monitor.c | 9 +++------
>> 1 file changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
>> index 01f3834db57..558272b147c 100644
>> --- a/softmmu/qdev-monitor.c
>> +++ b/softmmu/qdev-monitor.c
>> @@ -1029,13 +1029,10 @@ int qemu_global_option(const char *str)
>> qemu_opt_set(opts, "value", str + offset + 1, &error_abort);
>> return 0;
>> }
>> + printf("Invalid 'global' option format. It must be provided as:\n");
>> + printf(" --global <driver>.<property>=<value>\n");
>
> Should these be something else tnan plain printf? (Such as qemu_prinf or
> qdev_printf or similar? Not sure how these work but plain printf in QEMU
> is usually not what's meant.)
I thought so first, but qemu_opts_print_help() calls plain printf()...
> Regards,
> BALATON Zoltan
>
>> - opts = qemu_opts_parse_noisily(&qemu_global_opts, str, false);
>> - if (!opts) {
>> - return -1;
>> - }
next prev parent reply other threads:[~2021-11-19 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 18:26 [RFC PATCH-for-6.2 v3] qdev-monitor: Only allow full --global <driver>.<property>=<val> option Philippe Mathieu-Daudé
2021-11-19 18:46 ` BALATON Zoltan
2021-11-19 19:07 ` Philippe Mathieu-Daudé [this message]
2021-11-20 6:53 ` Markus Armbruster
2021-11-22 13:21 ` Daniel P. Berrangé
2021-11-22 14:32 ` Markus Armbruster
2021-11-23 13:17 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23766d94-96da-d2c7-eb12-2e830e178d0c@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=balaton@eik.bme.hu \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).