From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OBTHH-0005Qu-MS for qemu-devel@nongnu.org; Mon, 10 May 2010 09:44:11 -0400 Received: from [140.186.70.92] (port=51174 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBTHA-0005Oc-PK for qemu-devel@nongnu.org; Mon, 10 May 2010 09:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBTH6-0005s2-2O for qemu-devel@nongnu.org; Mon, 10 May 2010 09:44:04 -0400 Received: from goliath.siemens.de ([192.35.17.28]:23526) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBTGq-0005pK-Qd for qemu-devel@nongnu.org; Mon, 10 May 2010 09:43:45 -0400 Message-ID: <4BE80D8C.4050609@siemens.com> Date: Mon, 10 May 2010 15:43:40 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: Registering buffers with a qdict References: <4BE3FD3F.4070606@siemens.com> <20100507100758.1050a374@redhat.com> <4BE421D9.30502@siemens.com> <20100507135902.2753bb4a@redhat.com> <4BE7E723.3000002@siemens.com> <4BE80A04.9090705@redhat.com> In-Reply-To: <4BE80A04.9090705@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel , Luiz Capitulino Avi Kivity wrote: > On 05/10/2010 01:59 PM, Jan Kiszka wrote: >> From a quick glance at the JSON spec, there is no room for a new type. I >> think we have to overload an existing one and convert that into a >> QBuffer (typically, we know the actual semantic). Hex string encoding is >> most compact, so I went this road. > > Base64 is even more compact. For sure, still room for improvements. There is just no encode() service in current qemu, so I went the lazy way so far. :) > >> But I'm open to change it into a true >> type if JSON actually allows it (or we are fine with breaking it). >> > > That ruins any possibility of using a standard json encoder/decoder on > the other end. > That was my concern as well. Such decoders would not able to tell strings apart from buffers as that can only be derived from the context. Still, they could visualize the result and/or forward it to some libqmp for proper interpretation. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux