From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2] qapi, qemu-options: make all parsing visitors parse boolean options the same
Date: Wed, 4 Nov 2020 12:34:15 +0100 [thread overview]
Message-ID: <4d4e833b-829d-3a94-98ed-e22180ca372f@redhat.com> (raw)
In-Reply-To: <87h7q51smo.fsf@dusky.pond.sub.org>
On 04/11/20 08:35, Markus Armbruster wrote:
>> + "boolean (on/off, yes/no, true/false, y/n)");
> Recommend to have the error message only mention the preferred form. I
> like the laconic "'on' or 'off'". It's really all the user needs to
> know.
>
I went for "boolean (on/off) value".
>
> Avoiding the full_name() on success isn't hard:
>
> if (!qapi_bool_parse(name, str, obj, NULL)) {
> error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
> full_name(qiv, name), "'on' or 'off'");
> return false;
> }
> return true;
Can't refuse.
>>
>> case QEMU_OPT_BOOL:
>> - return parse_option_bool(opt->name, opt->str, &opt->value.boolean,
>> - errp);
>> + return qapi_bool_parse(opt->name, opt->str, &opt->value.boolean, errp);
>
> Please break the line the same way as before.
Why? It's not even 80 characters.
Paolo
prev parent reply other threads:[~2020-11-04 11:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 16:13 [PATCH v2] qapi, qemu-options: make all parsing visitors parse boolean options the same Paolo Bonzini
2020-11-03 16:25 ` Daniel P. Berrangé
2020-11-03 16:33 ` Paolo Bonzini
2020-11-03 16:46 ` Daniel P. Berrangé
2020-11-04 8:29 ` Markus Armbruster
2020-11-04 11:31 ` Paolo Bonzini
2020-11-04 11:36 ` Daniel P. Berrangé
2020-11-04 13:28 ` Markus Armbruster
2020-11-04 7:35 ` Markus Armbruster
2020-11-04 11:34 ` Paolo Bonzini [this message]
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=4d4e833b-829d-3a94-98ed-e22180ca372f@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).