From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqURY-0004Re-7k for qemu-devel@nongnu.org; Wed, 23 Sep 2009 12:11:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqURT-0004OW-8L for qemu-devel@nongnu.org; Wed, 23 Sep 2009 12:11:47 -0400 Received: from [199.232.76.173] (port=54947 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqURT-0004ON-31 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 12:11:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8724) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqURS-0008F5-Hf for qemu-devel@nongnu.org; Wed, 23 Sep 2009 12:11:42 -0400 Date: Wed, 23 Sep 2009 13:11:23 -0300 From: Luiz Capitulino Subject: Re: [Qemu-devel] ANN: QEMU Monitor Protocol git tree Message-ID: <20090923131123.542fbd85@doriath> In-Reply-To: <87my4lir9z.fsf@pike.pond.sub.org> References: <20090921224430.610da97b@doriath> <4AB98034.3060608@codemonkey.ws> <20090923095701.GE29269@redhat.com> <87my4lir9z.fsf@pike.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: avi@redhat.com, qemu-devel@nongnu.org On Wed, 23 Sep 2009 18:01:44 +0200 Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > On Tue, Sep 22, 2009 at 08:56:04PM -0500, Anthony Liguori wrote: > >> Luiz Capitulino wrote: > >> >Now the controversial part: it's json based. ;) > >> > > >> >I have chosen json because of the reasons already explained by others in > >> >the original QMP thread. Basically, json is so simple that if we design > >> >a small protocol from scratch, chances are it will look like json. > >> > > >> > >> json is not a deal break. My main concern was our ability to extend > >> json and whether supporting stock json libraries was a hard > >> requirement. I also would like to see a C client library since our > >> biggest consumer (libvirt) is based in C. > > > > I've googled around quickly and there are at least 5 pieces of C code > > and/or C libraries that can parse JSON. Hopefully one of them will be > > sufficient / suitable for libvirt's needs. We'll just need to try it > > out and see what happens.... > > > >> >2.1 General Definitions > >> >----------------------- > >> > > >> >All interactions transmitted by Client and Server are json-objects that end > >> >with CRLF. > >> > > >> > >> CRLF? Really? > >> > >> Ignoring the dos-ism, since you can parse JSON with a regexp, why do we > >> need explicit message boundaries? > > > > I think it would be nice to be able to assume that each JSON message > > will not cross a line-end boundary. Whether we use CRLF, just CR or > > just LF I don't mind. Its much easier to search for a message boundary > > by just doing strchr('\n') than having to actually parse the JSON or > > use a regexp at that point. > > > > Daniel > > If the objective is to make life as easy as possible for clients, then > terminate lines with just LF. Okay, but note that the '\r\n' are there because it's what QEMU does today (look at monitor_puts()).