Received: from eggs.gnu.org ([2001:4830:134:3::10]:37362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZxBc-0002XD-3k for qemu-devel@nongnu.org; Sat, 04 Feb 2017 05:03:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZxBY-0003ei-3R for qemu-devel@nongnu.org; Sat, 04 Feb 2017 05:03:16 -0500 Sender: Paolo Bonzini References: <87bmukmlau.fsf@dusky.pond.sub.org> <20170202202739.GA15804@work-vm> <87shnvhfwc.fsf@dusky.pond.sub.org> <6e65ad3c-db00-0ce5-a9c6-0e8ba84ad3c6@redhat.com> <87zii270hm.fsf@dusky.pond.sub.org> From: Paolo Bonzini Message-ID: Date: Sat, 4 Feb 2017 02:03:07 -0800 MIME-Version: 1.0 In-Reply-To: <87zii270hm.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Non-flat command line option argument syntax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Max Reitz Cc: Kevin Wolf , "Dr. David Alan Gilbert" , qemu-block@nongnu.org, qemu-devel@nongnu.org On 04/02/2017 01:45, Markus Armbruster wrote: >>> -drive driver=qcow2, >>> file.driver=gluster, >>> .volume=testvol, >>> .path=/path/a.qcow2, >>> .debug=9, >>> file.server.0.type=tcp, >>> .host=1.2.3.4, >>> .port=24007, >>> file.server.1.type=unix, >>> .socket=/var/run/glusterd.socket >>> >>> Mind, I'm not at all sure this is a *good* idea. I suspect it's more >>> magic than it's worth. >> As someone who likes dot syntax very much, I don't like it. If you >> structure it like this, it's OK, but then you can just write the full >> prefix (which gets the point across just as well because I can quickly >> tell from a glance that it's the same prefix). >> >> OTOH, when joined into a single line it doesn't change much in terms of >> legibility, in my opinion. > > Thanks! Actually I think it does improve legibility. It doesn't improve writability though, as anecdotally proved by Markus's own mistake. I am a fan of the dot syntax too. It seems to be the most incremental solution, and it's still as expressive as JSON. _However_ we could also extend -readconfig to support JSON, i.e. instead of [drive "abc"] file = "foo" it could support { 'drive': { 'file: 'foo' }, 'id': 'abc' } In other words [ would introduce key-value QemuOpts with dot syntax, while { would introduce JSON. Paolo