From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxdMp-0006A1-MA for qemu-devel@nongnu.org; Fri, 21 Oct 2016 13:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxdMo-0004xf-Hw for qemu-devel@nongnu.org; Fri, 21 Oct 2016 13:12:27 -0400 References: <1475246744-29302-1-git-send-email-berrange@redhat.com> <1475246744-29302-2-git-send-email-berrange@redhat.com> <87shrpfxpf.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <4e94fe14-936b-12f2-9c68-245e3a0f7a58@redhat.com> Date: Fri, 21 Oct 2016 12:12:19 -0500 MIME-Version: 1.0 In-Reply-To: <87shrpfxpf.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CKOP69Q1CbroioENsvcDWFIPXvx9XFu1d" Subject: Re: [Qemu-devel] [PATCH v14 01/21] option: make parse_option_bool/number non-static List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , "Daniel P. Berrange" Cc: Paolo Bonzini , =?UTF-8?Q?Andreas_F=c3=a4rber?= , qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CKOP69Q1CbroioENsvcDWFIPXvx9XFu1d From: Eric Blake To: Markus Armbruster , "Daniel P. Berrange" Cc: Paolo Bonzini , =?UTF-8?Q?Andreas_F=c3=a4rber?= , qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz Message-ID: <4e94fe14-936b-12f2-9c68-245e3a0f7a58@redhat.com> Subject: Re: [Qemu-devel] [PATCH v14 01/21] option: make parse_option_bool/number non-static References: <1475246744-29302-1-git-send-email-berrange@redhat.com> <1475246744-29302-2-git-send-email-berrange@redhat.com> <87shrpfxpf.fsf@dusky.pond.sub.org> In-Reply-To: <87shrpfxpf.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/21/2016 11:55 AM, Markus Armbruster wrote: >=20 > On first glance, this patch makes the boolean values recognized on the > command line consistent regardless of which part of the code is used to= > recognize them, by extending the QemuOpts parser to accept the option > visitor's additional convenience values. >=20 > Once we've done that in a release, we can't go back. No problem if it > actually achieved consistency. But it doesn't: there are other parsers= > that recognize only "on" and "off". A quick grep finds > select_display(), bdrv_open_inherit(), netfilter_set_status(). Would it be wrong to convert these to use the same function, to get us to the point where they are consistent instead of self-limited? Yes, it means that newer qemu will accept spellings that older doesn't, and that we can't later prune the set of spellings back down, but trying to remain backwards-compatible to every different set of inputs on a command-by-command basis is harder than just making all commands accept all spellings. >=20 > bdrv_open_inherit() is particularly instructive: -drive gets parsed by > QemuOpts (evidence: your patch makes read-only=3Dy work), but by the ti= me > the options arrive here, they're a QDict. Curiously, > bdrv_open_inherit() expects the value of key "read-only" to be a > *string*, and it checks for "on". Fortunately, something on the way to= > bdrv_open_inherit() replaces the "y" by "on", so this works. My point > is: this patch is trickier than it looks on first glance. >=20 > There's also HMP, which continues to accept only "on" and "off". Particularly for HMP, where we DON'T have backwards-compatibility constraints, I'd argue that ease-of-use is the driving factor and that HMP should allow ALL spellings of boolean arguments. >=20 > We might want to treat the option visitor's additional boolean values > like its other syntax extensions: keep for compatibility, but confine > to existing uses. As in - new interfaces ONLY get to pass "true" or "false", and only existing interfaces get to also pass "y" or "on"? >=20 > I think we should decide that when we merge the rest of your option > visitor replacement work, hopefully in 2.9. >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --CKOP69Q1CbroioENsvcDWFIPXvx9XFu1d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYCkxzAAoJEKeha0olJ0Nq1RQIAImExbLzE5KVfu0Body0exaM hBfpYaidgr2guZfIGwH2eiqTvqztqRw0pDiXaUGwVTeU1aV6/8b0N/thER3gGBKJ 4HerTbLoXBxf/63N5pori3zautpCXODlWMRiswjzkNN7FZIA6iVmZUcBnE26NGKN XfD2Olt75d+ts/wZFqGfHSadIDJOKRfTgFki68N18rxziPEesdDpQv/au0BQKmX+ 29W9TKDmV256dVMP03wb1QC3W3kDeABEzxGEMH+oP64MrQIrtHEHpXa6IyAPCEXR di7TyT4OequKHYQmhfMNFGXrcl1zDeMJol+47kNoLcenzGvOgHlH2fqlI1FNpyo= =nENm -----END PGP SIGNATURE----- --CKOP69Q1CbroioENsvcDWFIPXvx9XFu1d--