From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJVEm-0003eZ-QK for qemu-devel@nongnu.org; Wed, 24 Jun 2009 12:22:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJVEi-0003Wm-2Z for qemu-devel@nongnu.org; Wed, 24 Jun 2009 12:22:16 -0400 Received: from [199.232.76.173] (port=39945 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJVEh-0003WD-TF for qemu-devel@nongnu.org; Wed, 24 Jun 2009 12:22:11 -0400 Received: from mail2.shareable.org ([80.68.89.115]:42725) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MJVEh-0006Uz-5x for qemu-devel@nongnu.org; Wed, 24 Jun 2009 12:22:11 -0400 Date: Wed, 24 Jun 2009 17:22:07 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file Message-ID: <20090624162207.GD14121@shareable.org> References: <4A40FE31.2010007@us.ibm.com> <4A40FFB0.2070905@redhat.com> <4A411FC5.7050701@us.ibm.com> <4A412339.5000109@redhat.com> <4A412659.1080803@us.ibm.com> <20090623220204.GA5612@snarc.org> <4A415C30.7030301@us.ibm.com> <20090624010108.GA6537@snarc.org> <4A42200C.6060600@codemonkey.ws> <4A422592.2000307@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A422592.2000307@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: ehabkost@redhat.com, jan.kiszka@siemens.com, dlaor@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino , Vincent Hanquez Avi Kivity wrote: > >With respect to RPC choice, if we did go that route, I'd be very > >concerned about using jsonrpc verses a more well established rpc. I > >would honestly prefer xml-rpc over jsonrpc. > > I agree xml-rpc is a more rational choice than jsonrpc, but I cannot > find it in my heart to say something nice about xml. Additionally, XML > parsers are pretty heavy. I'm not defending XML here, but: You can code a minimal XML parser in straight C quite easily, if it's a restricted subset. That is, if you specify the XML won't use any of the irrelevant features like PIs, DTDs, namespaces and named entities and know it's all UTF-8. Maybe even no comments. Then it's just nested elements, attributes and strings, with < to escape a few characters. But the XML-RPC spec does not appear to restrict the type of XML, so you have to handle every XML feature to be XML-RPC compliant, unfortunately. Some other "wire" protocols do specify a reduced subset of XML, which means you don't have to use a heavyweight library for them, which is nice. I think feature-restricted XML is quite good for this sort of thing. It's a bit more self-documenting than JSON. But for some reason, lots of XML users use it very badly, doing stupid things like int00.... That's an exaggeration but I'm sure you all recognise the pattern. XML and JSON both have the same ugly problem with binary data: they can't carry it. It's usually base64 encoded. Then again the QEMU monitor is no better this respect :-) -- Jamie