Received: from eggs.gnu.org ([2001:4830:134:3::10]:59426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwqy3-0007gO-W5 for qemu-devel@nongnu.org; Wed, 19 Oct 2016 09:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwqxz-00016o-KL for qemu-devel@nongnu.org; Wed, 19 Oct 2016 09:31:39 -0400 References: <1475246744-29302-1-git-send-email-berrange@redhat.com> <1475246744-29302-14-git-send-email-berrange@redhat.com> <87fuo0a0kl.fsf@dusky.pond.sub.org> <20161013144640.GN5803@noname.redhat.com> <87a8e3av2r.fsf@dusky.pond.sub.org> <20161018093423.GA4706@noname.str.redhat.com> <87eg3dk6u9.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: Date: Wed, 19 Oct 2016 08:31:28 -0500 MIME-Version: 1.0 In-Reply-To: <87eg3dk6u9.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3WspwaeclKJIQwHOjugvjidMwjMp83kQq" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v14 13/21] qdict: allow qdict_crumple to accept compound types as values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Kevin Wolf Cc: Paolo Bonzini , Max Reitz , =?UTF-8?Q?Andreas_F=c3=a4rber?= , qemu-block@nongnu.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3WspwaeclKJIQwHOjugvjidMwjMp83kQq From: Eric Blake To: Markus Armbruster , Kevin Wolf Cc: Paolo Bonzini , Max Reitz , =?UTF-8?Q?Andreas_F=c3=a4rber?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Message-ID: Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v14 13/21] qdict: allow qdict_crumple to accept compound types as values References: <1475246744-29302-1-git-send-email-berrange@redhat.com> <1475246744-29302-14-git-send-email-berrange@redhat.com> <87fuo0a0kl.fsf@dusky.pond.sub.org> <20161013144640.GN5803@noname.redhat.com> <87a8e3av2r.fsf@dusky.pond.sub.org> <20161018093423.GA4706@noname.str.redhat.com> <87eg3dk6u9.fsf@dusky.pond.sub.org> In-Reply-To: <87eg3dk6u9.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/18/2016 10:35 AM, Markus Armbruster wrote: >>>> But even if I realised that QemuOpts support this syntax, I think we= >>>> would still have to use the dotted syntax because it's explicit abou= t >>>> the index and we need that because the list can contains dicts. >>>> >>>> Compare this: >>>> >>>> driver=3Dquorum, >>>> child.0.driver=3Dfile,child.0.filename=3Ddisk1.img, >>>> child.1.driver=3Dhost_device,child.1.filename=3D/dev/sdb, >>>> child.2.driver=3Dnbd,child.2.host=3Dlocalhost >>>> >>>> And this: >>>> >>>> driver=3Dquorum, >>>> child.driver=3Dfile,child.filename=3Ddisk1.img, >>>> child.driver=3Dhost_device,child.filename=3D/dev/sdb, >>>> child.driver=3Dnbd,child.host=3Dlocalhost >>> >>> Aside: both are about equally illegible, to be honest. Furthermore, both of these currently require really long command lines. Overnight, I was thinking about whether it would be worth improving QemuOpts to ignore whitespace after (unquoted) commas, so you can do: -drive 'driver=3Dquorum, child.0.driver=3Dfile, child.0.filename=3Ddisk1.img, child.1.driver=3Dhost_device, child.1.filename=3D/dev/sdb, child.2.driver=3Dnbd, child.2.host=3Dlocalhost ' I think this one should be just fine - we don't have ANY keys that start with leading whitespace, so ignoring space will still let us parse out key names, but allow for much more legibility in the command lines. And this is true whether we use dotted notation... >>> If you'd rather invent syntax closer to QemuOpts than reuse JSON, you= >>> could try >>> >>> driver=3Dquorum, >>> child=3D[{ driver=3Dfile, filename=3Ddisk1.img }, >>> { driver=3Dhost_device, filename=3D/dev/sdb }, >>> { driver=3Dnbd, host=3Dlocalhost } ] >> >> This looks a lot more agreeable as something that I have to type on th= e >> command line. =2E..or new syntax (where of course the new syntax has already demonstrated that we want to support strategic ignoring of whitespace). So I'll probably propose a patch along those lines soon, as it seems like an orthogonal improvement. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3WspwaeclKJIQwHOjugvjidMwjMp83kQq 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/ iQEcBAEBCAAGBQJYB3WwAAoJEKeha0olJ0NqM0UH/j+pR7U3SQ8rdTrQqo8yHH5U KolzW6FP+aUxKPW11+6uQabCVRiFoul+S0WV5o1muXSUjGIZSV90b3n4HD27qI4H CiWr4lC98AvAetTGfWiBpEvbWQBnF/Cdm9CuQ2bRrgMRnLs6aWBy/rL2ycgzlTOY B+4KiT04Dfa5TsFUmOwcY1bhToUHZzdGhCk+O59WjUG9+LasUcLQ0SWQqox3SCMS HXWnzrnAaxr8XApV7WjDg4jSNK0LxZzmCNutVbrV1pXdHIEix3L24dtf0TMMSBeu mxVS+QqvsqcmwzjbCxONCWTCScqZRCgKjfQPLoRwolbczTaiEb466qPPF4F2qYE= =6ME9 -----END PGP SIGNATURE----- --3WspwaeclKJIQwHOjugvjidMwjMp83kQq--