From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43054 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEQXY-0001aK-DU for qemu-devel@nongnu.org; Tue, 18 May 2010 13:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEQXR-0001DY-Kp for qemu-devel@nongnu.org; Tue, 18 May 2010 13:25:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36652) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEQXR-0001Cw-An for qemu-devel@nongnu.org; Tue, 18 May 2010 13:25:05 -0400 Message-ID: <4BF2CD6B.7080909@redhat.com> Date: Tue, 18 May 2010 20:24:59 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 3/8] Add QBuffer References: <6e14cbfe3764b46d9bd6d2db61d41fd9c85dd54e.1273843151.git.jan.kiszka@siemens.com> <4BED9358.1000106@codemonkey.ws> <20100516173809.GA29814@shareable.org> <4BF0E6CD.7090909@redhat.com> <4BF0F2FD.90408@siemens.com> <4BF0F437.6040302@redhat.com> <4BF0F6D3.8020803@siemens.com> <4BF0FA13.10808@redhat.com> <4BF10481.7030900@siemens.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Jan Kiszka , Anthony Liguori , Luiz Capitulino , "qemu-devel@nongnu.org" , Juan Quintela On 05/18/2010 03:27 PM, Markus Armbruster wrote: > >>> Surely the schema has to describe the type as well? If it does, you can >>> use the schema to generate a classes at compile time. >>> > Doesn't that tie you to a specific version of QMP at compile-time? > The client needs to ignore anything not provided by the schema to be forward compatible. (alternatively we make sure anything new is explicitly enabled by the client, so it can parse strictly according to the schema). > >>>> but their types (int, buffer, sub-field, array of X) are >>>> derived from the JSON objects (ie. the JSON parser does this job). >>>> >>>> >>> The names of fields are also type information. >>> >> Not in the case of device_show. The clients have no idea of the vmstate >> structures before they were transfered. Granted, that will likely remain >> a special case in the QMP command set. >> > qdev device properties are similar. Right now, they occur only as > arguments of device_add. When do_info_qtree() gets converted, they'll > appear in results. > This sounds like a horror movie in the making, "sysfs: the return". The qdev tree is completely undocumented, so once again the code dictates the protocol. Any bug in the qdev hierarchy will be hardcoded forever and ever, or we have to add a new layer of indirection to have a separate internal qdev and an external qdev-for-qmp tree(s). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.