From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41070 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxfBl-0007Gq-EI for qemu-devel@nongnu.org; Thu, 10 Mar 2011 07:41:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxfBk-0003Vk-By for qemu-devel@nongnu.org; Thu, 10 Mar 2011 07:41:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxfBj-0003V7-UC for qemu-devel@nongnu.org; Thu, 10 Mar 2011 07:41:56 -0500 Message-ID: <4D78C70E.7000408@redhat.com> Date: Thu, 10 Mar 2011 14:41:50 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> <1299460984-15849-15-git-send-email-aliguori@us.ibm.com> <4D778246.8090504@redhat.com> <4D778A9F.80700@codemonkey.ws> <4D77909B.90800@redhat.com> <4D7792E8.4020402@codemonkey.ws> In-Reply-To: <4D7792E8.4020402@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , Luiz Capitulino , qemu-devel@nongnu.org, Markus Armbruster On 03/09/2011 04:47 PM, Anthony Liguori wrote: >> [ >> >> { 'type': 'MyType', fields: [['a', 'str'], ['b', 'int'], ['c', >> 'AnotherType']] } >> { 'event': 'MY_EVENT', 'arguments': [ ... ] } >> { 'command': 'my-command', 'arguments': [ ... ], 'return': ... } >> >> ] >> >> which leaves us room for additional metainformation. >> >> The concern is more about non-qemu consumers of the schema. > > > Yeah, I dislike it too and I've been leaning towards changing it. > > My preference would be: > > { 'type': 'MyType', 'fields': { 'a': 'str', 'b': 'int', 'c': > 'AnotherType' } } > { 'event': 'MY_EVENT', 'arguments': {...} } > { 'command': 'my-command', 'arguments': {...}, 'returns': 'int' } > > I do prefer the dictionary syntax for arguments over a list because a > list implies order. Plus I think the syntax is just awkward and a > whole lot easier to get wrong (too many/few elements in list). Yeah. We can rationalize it by saying that most dynamic consumers of the schema will not care about argument order, and that if they do, they can implement a custom parser. > I don't think I want to make this sort of change just yet. Also note > that the schema that will be exposed over the wire is not directly > related to the schema we use for code generation. Right, we have to nail down the format for the former, though. -- error compiling committee.c: too many arguments to function