From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqWhX-0000du-3H for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:36:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqWhR-0000da-Kk for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:36:25 -0400 Received: from [199.232.76.173] (port=60584 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqWhR-0000dX-H1 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 14:36:21 -0400 Date: Wed, 23 Sep 2009 19:36:17 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: ANN: QEMU Monitor Protocol git tree Message-ID: <20090923183617.GD23822@shareable.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ABA65DF.6050607@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , Luiz Capitulino , Avi Kivity , qemu-devel@nongnu.org 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. :-) -- Jamie