qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file
Date: Sun, 28 Jun 2009 16:13:04 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 06/26/2009 06:02 PM, Anthony Liguori wrote:
# v1 ->  v2
#  o allow integer in symbol names (C-style)
#  o allow negative integer/floats
#  o no newlines in strings
#  o one value per response_data line

__skip__: [ \t]+

symbol: [A-Za-z_\-][A-Za-z_\-0-9]*

decimalinteger: (-)?[1-9][0-9]+

Traditionally, 0 is recognized as an integer.

hexinteger: 0x[0-9]+

[a-fA-f]

float: (-)?[0-9]+\.[0-9]+

5, 3., .10, 1e9 are all floats.

string: \"([^\"\\\n]|(\\[0-9][0-9][0-9]))*\" | symbol

I think json recognises 'blah' but not symbol. Also it may recognize other escapes.

It's important to allow clients to use json emitters so they can construct a dict and throw it at qemu, similarly to parse qemu results.

arg_list: value arg_list?

command: symbol arg_list? '\n'

Better to use a dictionary for the argument list (more self-documenting, easier expansion).

I'd also adopt jsonrpc's request and id attributes, they allow async commands and remove the need for any specialized parsing.

response_status: ('+' | '-') number string? '\n'
response_data: '=' value '\n'
async_msg: '*' arg_list '\n'


Similarly, return a value that contains message type, id, and return value.

I think it's fine to drop jsonrpc as the standard (but retain its features) and just adopt json for encoding.

--
error compiling committee.c: too many arguments to function





reply via email to

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