qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH 01/11] QMP: Introduce specification file
Date: Wed, 24 Jun 2009 17:22:07 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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
<array><element><type><typename>int</typename></type><subscript>0</subscript><element-value>0</element-value></element>...</array>.
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




reply via email to

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