From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40492 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODatF-00045A-DS for qemu-devel@nongnu.org; Sun, 16 May 2010 06:16:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODatD-0004rL-F1 for qemu-devel@nongnu.org; Sun, 16 May 2010 06:16:09 -0400 Received: from fg-out-1718.google.com ([72.14.220.157]:33279) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODatD-0004rG-7M for qemu-devel@nongnu.org; Sun, 16 May 2010 06:16:07 -0400 Received: by fg-out-1718.google.com with SMTP id 16so846615fgg.10 for ; Sun, 16 May 2010 03:16:06 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4BEFC5E4.5010208@redhat.com> Date: Sun, 16 May 2010 12:16:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <6e14cbfe3764b46d9bd6d2db61d41fd9c85dd54e.1273843151.git.jan.kiszka@siemens.com> <4BED9358.1000106@codemonkey.ws> <4BEE5F0F.2060600@web.de> <4BEE6035.2070906@redhat.com> <4BEE6254.6060701@web.de> <4BEEDA7E.7060805@redhat.com> <4BEFBCE8.1030704@redhat.com> <4BEFBFE9.7010005@redhat.com> In-Reply-To: <4BEFBFE9.7010005@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/8] Add QBuffer List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Anthony Liguori , Juan Quintela , qemu-devel@nongnu.org, Markus Armbruster , Luiz Capitulino , Jan Kiszka On 05/16/2010 11:50 AM, Avi Kivity wrote: > On 05/16/2010 12:37 PM, Paolo Bonzini wrote: >> On 05/15/2010 07:31 PM, Avi Kivity wrote: >>> On 05/15/2010 11:59 AM, Jan Kiszka wrote: >>>> >>>>> Is this __class__ stuff documented anywhere? >>>>> >>>> Not yet. Also, we should clarify the proposed private extension section >>>> that only "__some_key" is reserved for downstream, not >>>> '__some_other_key__' (i.e. downstream names must not end with '__'). >>>> >>> >>> Why use such weird names at all? What's wrong with 'class'? >> >> That it conflicts with e.g. PCI classes? > > Won't the context tell it apart? Yes, of course, it you need to know the schema. If you don't know the schema you don't know the context. This QBuffer thing is something that a client QMP library could create automatically. Keys in a separate namespace (like '__class__') have the advantage of being easily picked up automatically by a wrapper of the JSON parser; if you used simply 'class' such as layer would need to know a schema, or it wouldn't know that "context". (BTW I'd prefer something like '__encoding__'; the word "class" suggests much more than what it is in reality). Paolo