From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqWqN-0003Wv-G6 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:45:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqWqI-0003Ti-Sv for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:45:35 -0400 Received: from [199.232.76.173] (port=38312 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqWqI-0003TV-G5 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:45:30 -0400 Received: from mail-fx0-f214.google.com ([209.85.220.214]:45632) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqWqI-0005OT-3K for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:45:30 -0400 Received: by fxm10 with SMTP id 10so856240fxm.8 for ; Wed, 23 Sep 2009 11:45:29 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4ABA6CC5.6050708@gnu.org> Date: Wed, 23 Sep 2009 20:45:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: ANN: QEMU Monitor Protocol git tree References: <20090921224430.610da97b@doriath> <4AB98034.3060608@codemonkey.ws> <20090923095701.GE29269@redhat.com> <4AB9FF35.9090208@redhat.com> <4ABA254A.3090703@gnu.org> <4ABA2AD2.3040005@redhat.com> <4ABA65DF.6050607@codemonkey.ws> <20090923183617.GD23822@shareable.org> In-Reply-To: <20090923183617.GD23822@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Luiz Capitulino , Avi Kivity , qemu-devel@nongnu.org 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