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é <[email protected]> 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 :|
