qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Re: ANN: QEMU Monitor Protocol git tree
Date: Wed, 23 Sep 2009 20:45:25 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

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".

Paolo




reply via email to

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