[email protected]
[Top] [All Lists]

Re: [Qemu-devel] Re: ANN: QEMU Monitor Protocol git tree

Subject: Re: [Qemu-devel] Re: ANN: QEMU Monitor Protocol git tree
From: Paolo Bonzini
Date: Wed, 23 Sep 2009 20:45:25 +0200
On 09/23/2009 08:36 PM, Jamie Lokier wrote:
Anthony Liguori wrote:
The main advantage of not relying on whitespace terminated messages is
that it gives us the ability to pretty print the protocol on the wire.
For instance, I'd rather read:

{ "execute": "info",
   "id" : "32",
   "arguments": ["cpus"]}

I agree.  It's not even expensive.

It's still useful for parsers to easily find the end before parsing.

So declare the JSON terminator to be "}\n" or "}\r\n".  That shouldn't
occur anywhere inside a pretty printed structure.  The internal
closing braces are all followed by a comma.

To be picky, you could have dictionaries pretty printed as

  'key': {
    'key': {
      'key': {}

I think it's either no-delimiter or "\n" or "\r\n".


<Prev in Thread] Current Thread [Next in Thread>