From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZytV-00045o-TN for qemu-devel@nongnu.org; Sat, 04 Feb 2017 06:52:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZytV-00044D-8N for qemu-devel@nongnu.org; Sat, 04 Feb 2017 06:52:41 -0500 From: Markus Armbruster 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> Date: Sat, 04 Feb 2017 12:52:32 +0100 In-Reply-To: (Paolo Bonzini's message of "Sat, 4 Feb 2017 02:03:07 -0800") Message-ID: <87poiy2mwv.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] Non-flat command line option argument syntax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Max Reitz , Kevin Wolf , "Dr. David Alan Gilbert" , qemu-block@nongnu.org, qemu-devel@nongnu.org Paolo Bonzini writes: > 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. Noted. > _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. Yes, we should support config files in JSON syntax. Not sure mixing INI and JSON syntax in the same file is a good idea, though.