From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@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 16:46:01 +0000 [thread overview]
Message-ID: <20201103164601.GS205187@redhat.com> (raw)
In-Reply-To: <e950af86-c45d-4165-a9f2-85ee6e845b01@redhat.com>
On Tue, Nov 03, 2020 at 05:33:47PM +0100, Paolo Bonzini wrote:
> 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).
Ok,
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-11-03 16:47 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é [this message]
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=20201103164601.GS205187@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.