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: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file
Date: Fri, 26 Jun 2009 10:02:11 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Anthony Liguori wrote:
Avi Kivity wrote:
Merging is a meaningless milestone since the protocol will not be enabled. Since we'll miss 0.11 in reality we have 7-8 months before the protocol can be used in production. IMO you're optimizing for the short term, disregarding long-term maintenance, and disregarding ease of implementation for users of the qemu monitor.

Here's an updated grammar.

One benefit of using our own grammar over just JSON-RPC that is line based is that lines form discrete PDUs. If you wanted to implement a JSON-RPC parser, you would have to be able to either invent your own PDU transmission mechanism or rely on the JSON parser to determine message boundaries. Since the later is likely to be a recursive decent parser, this is difficult to work into an asynchronous client library. The same is true for XML-RPC. With XML-RPC, you rely on HTTP's Content-Length header to determine boundaries.

By having a well defined PDU, you can hand lines to the parser and be sure that the recursion will complete without requiring more data.

Regards,

Anthony Liguori
# QMP 1.0

# 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]+
hexinteger: 0x[0-9]+
float: (-)?[0-9]+\.[0-9]+

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

number: float | decimalinteger | hexinteger

comma_arg_list: value (',' comma_arg_list)?
list: '[' comma_arg_list? ']'

dict_list: string ':' value (',' dict_list)?
dictionary: '{' dict_list? '}' 

value: (string | number | list | dictionary)

arg_list: value arg_list?

command: symbol arg_list? '\n'

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

response: async_msg | response_data* response_status

reply via email to

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