[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command
Date: Thu, 10 Mar 2011 07:52:34 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

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' } }


Anthony Liguori

reply via email to

[Prev in Thread] Current Thread [Next in Thread]