From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [PATCH v2] qapi, qemu-options: make all parsing visitors parse boolean options the same
Date: Tue, 3 Nov 2020 17:33:47 +0100 [thread overview]
Message-ID: <e950af86-c45d-4165-a9f2-85ee6e845b01@redhat.com> (raw)
In-Reply-To: <20201103162551.GQ205187@redhat.com>
On 03/11/20 17:25, Daniel P. Berrangé wrote:
>> OptsVisitor, StringInputVisitor and the keyval visitor have
>> three different ideas of how a human could write the value of
>> a boolean option. Pay homage to the backwards-compatibility
>> gods and make the new common helper accept all four sets (on/off,
>> true/false, y/n and yes/no), and case-insensitive at that.
>>
>> Since OptsVisitor is supposed to match qemu-options, adjust
>> it as well.
> FWIW, libvirt does not appear to use true/false or y/n, nor
> ever use uppercase / mixed case.
>
> IOW this level of back compat may well be overkill.
>
> I'd particular suggest deprecating case-insensitivity, as
> Yes, YES, yEs feel unlikely to be important or widely used.
True; at least it's type-safe code unlike the short-form boolean option.
It only hurts in the odd case of a boolean option becoming on/off/auto
or on/off/split.
I didn't want to introduce deprecation at this point, because
consistency is better anyway even if we plan to later deprecate
something. For example, since there is a common parser now, introducing
deprecation would be much easier. It also lets us switch parsers even
during the deprecation period (which is how I got into this mess).
Paolo
next prev parent reply other threads:[~2020-11-03 16: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 [this message]
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
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=e950af86-c45d-4165-a9f2-85ee6e845b01@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@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).