qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] qapi, qemu-options: make all parsing visitors parse boole


From: Daniel P . Berrangé
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
User-agent: Mutt/1.14.6 (2020-07-11)

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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]