From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49036 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxgIB-000755-CD for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxgI9-0002PQ-QJ for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:52:39 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:54388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxgI9-0002PG-LZ for qemu-devel@nongnu.org; Thu, 10 Mar 2011 08:52:37 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2A9XYxE023936 for ; Thu, 10 Mar 2011 04:33:34 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 57A0A38C8039 for ; Thu, 10 Mar 2011 08:52:33 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2ADqZiF208674 for ; Thu, 10 Mar 2011 08:52:35 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2ADqZtq015377 for ; Thu, 10 Mar 2011 10:52:35 -0300 Message-ID: <4D78D7A2.1010102@us.ibm.com> Date: Thu, 10 Mar 2011 07:52:34 -0600 From: Anthony Liguori 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> <4D78C70E.7000408@redhat.com> In-Reply-To: <4D78C70E.7000408@redhat.com> 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: Avi Kivity Cc: Luiz Capitulino , qemu-devel@nongnu.org, Markus Armbruster On 03/10/2011 06:41 AM, Avi Kivity wrote: >> 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. There's also enum syntax which I guess would be: { 'enum': 'MyEnum', values: [ 'value1', 'value2', 'value3' ] } The other thing that I'm delaying until post 0.15 is errors. I'd like to define errors as part of the schema. Something like: { 'error': 'FileNotFound', 'arguments': { 'filename': 'str' } } Regards, Anthony Liguori