From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNhZw-0003zW-Ee for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:25:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNhZq-0003Sx-FB for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:25:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNhZq-0003St-6o for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:25:22 -0400 References: <1468468228-27827-1-git-send-email-eblake@redhat.com> <1468468228-27827-17-git-send-email-eblake@redhat.com> <20160714080423.GB18778@redhat.com> <578788E4.9020205@redhat.com> <20160714130327.GG18778@redhat.com> <57879BED.6090002@redhat.com> <20160714141657.GH18778@redhat.com> From: Eric Blake Message-ID: <5787A0D0.7090004@redhat.com> Date: Thu, 14 Jul 2016 08:25:20 -0600 MIME-Version: 1.0 In-Reply-To: <20160714141657.GH18778@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QdqnaGTCdItjnOq6wbfi0pghxKPrwTpbN" Subject: Re: [Qemu-devel] [PATCH v9 16/17] qapi: Tweak QmpInputVisitor to optionally do string conversion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, armbru@redhat.com, Michael Roth , =?UTF-8?Q?Andreas_F=c3=a4rber?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QdqnaGTCdItjnOq6wbfi0pghxKPrwTpbN From: Eric Blake To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, armbru@redhat.com, Michael Roth , =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <5787A0D0.7090004@redhat.com> Subject: Re: [PATCH v9 16/17] qapi: Tweak QmpInputVisitor to optionally do string conversion References: <1468468228-27827-1-git-send-email-eblake@redhat.com> <1468468228-27827-17-git-send-email-eblake@redhat.com> <20160714080423.GB18778@redhat.com> <578788E4.9020205@redhat.com> <20160714130327.GG18778@redhat.com> <57879BED.6090002@redhat.com> <20160714141657.GH18778@redhat.com> In-Reply-To: <20160714141657.GH18778@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/14/2016 08:16 AM, Daniel P. Berrange wrote: > On Thu, Jul 14, 2016 at 08:04:29AM -0600, Eric Blake wrote: >> On 07/14/2016 07:03 AM, Daniel P. Berrange wrote: >> >> 3 is a superset of 2, and your command-line conversion is the only cas= e >> where we can achieve 2. That is, code dealing with QMP can only choos= e >> between 1 and 3, based on whether the QAPI .json file used >> 'autocast':true for back-compat reasons (the only candidates are >> 'netdev_add' and 'device_add'). And code dealing with command line >> parsing can only choose 2 (QemuOpts is string-only), but parsing >> string-only via 2 is no different than the result achieved from parsin= g >> strongly-typed with string fallback via 3. >> >> I still don't buy the fact that we need a string-only parser at the >> moment, but it would not be hard to change the 'bool autocast' into a >> tri-state enum, and then make the implementation specifically honor 1,= >> 2, or 3 based on the enum value. >=20 > FYI, I just copied you on a patch that enables us to easily support > all 3 options. Yours achieves that by having three separate constructors, instead of one constructor with a tri-state enum parameter. Either approach works; Markus, do you have any opinions on which looks nicer? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --QdqnaGTCdItjnOq6wbfi0pghxKPrwTpbN 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/ iQEcBAEBCAAGBQJXh6DQAAoJEKeha0olJ0NqtA4IAKihqjmiAKTYi2g46rt1GLeU tHYbXaAzqr+rYMj8e22AhioiwV+epOh7dTxmZ3vfAZ8bw/8wo0k9Z91xVAYGpCp0 qnppEFhfRThbpBh6oqjKOcqMfnopTcfmfCG1wk6T4dLhM2cqNyBtNBZKZSeDjusv 39ypRLWUPtFeD7zLlVih39/cfHlkP4xRGviF8bD6AL6DZTuToIzomF+j4Q2X1XeD ySOFUFtM+8Zbi7dJPlFbJenpu8Thqk70WPJHKt0rJf1tOJjg4oO+/FsZDlLoLix8 3RSa4zaTq4ziRKTWS5xxw2c77Dg3xSmdqTNCzMP1juprKl3s1pTRd8mnPtU6e8s= =u4ff -----END PGP SIGNATURE----- --QdqnaGTCdItjnOq6wbfi0pghxKPrwTpbN--