Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUc3y-0003LM-0q for qemu-devel@nongnu.org; Tue, 12 Jan 2010 03:25:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUc3s-0003Kk-7x for qemu-devel@nongnu.org; Tue, 12 Jan 2010 03:25:16 -0500 Received: from [199.232.76.173] (port=42421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUc3r-0003Kd-Bu for qemu-devel@nongnu.org; Tue, 12 Jan 2010 03:25:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36488) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUc3q-0003vy-V3 for qemu-devel@nongnu.org; Tue, 12 Jan 2010 03:25:11 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 11/11] Change the monitor to use the new do_info_qtree. References: <1261862362-2530-1-git-send-email-nathan@parenthephobia.org.uk> <1261862362-2530-12-git-send-email-nathan@parenthephobia.org.uk> <20091229151508.35c4bc55@doriath> <1262114724.4088.17.camel@athens> <20091229191317.6385ae2d@doriath> Date: Tue, 12 Jan 2010 09:25:05 +0100 In-Reply-To: <20091229191317.6385ae2d@doriath> (Luiz Capitulino's message of "Tue, 29 Dec 2009 19:13:17 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Nathan Baum , qemu-devel@nongnu.org Luiz Capitulino writes: > On Tue, 29 Dec 2009 19:25:24 +0000 > Nathan Baum wrote: > >> On Tue, 2009-12-29 at 15:15 -0200, Luiz Capitulino wrote: >> > On Sat, 26 Dec 2009 21:19:22 +0000 >> > Nathan Baum wrote: >> > >> > > Signed-off-by: Nathan Baum >> > > --- >> > > hw/qdev.c | 9 ++++++++- >> > > hw/qdev.h | 3 ++- >> > > monitor.c | 3 ++- >> > > 3 files changed, 12 insertions(+), 3 deletions(-) >> > > >> > > diff --git a/hw/qdev.c b/hw/qdev.c >> > > index f5d68c6..d9d3778 100644 >> > > --- a/hw/qdev.c >> > > +++ b/hw/qdev.c >> > > @@ -727,6 +727,12 @@ static void do_info_qbus(Monitor *mon, BusState *bus, QObject **ret_data) >> > > *ret_data = (QObject *) qdict; >> > > } >> > > >> > > +void do_info_qtree(Monitor *mon, QObject **ret_data) >> > > +{ >> > > + if (main_system_bus) >> > > + do_info_qbus(mon, main_system_bus, ret_data); >> > > +} >> > > + >> > >> > What I'm missing here is a high-level documentation of the >> > data type you're building. >> >> Oh yes. I didn't think about that! >> >> I'm not sure if there's a policy on how complicated QMP responses will >> be documented? > > No. Markus and I have just started talking about a documentation format > for QMP. That was just before Christmas, and that's why I haven't gotten around to posting it here properly. > Markus, it's time to dump your ideas on the list. Indeed. I'm working on it, and hope get it posted today. >> One possibility that seems quite nice is to use something like JSON >> Schema[1], which describes JSON objects using JSON, since that means QMP >> clients can ask Qemu itself to describe its own protocol, and the result >> could be automatically processed (with some hypothetical "qmpdoc" tool) >> to produce human-readable documentation. > > This looks very good! It does. Thanks for the pointer! > We were considering something along these lines > but we didn't consider having the description as part of the dict, > for example. We did, actually :) > This solves some issues we were trying to address. > > The only problem I can see is that the documentation and code will > be in different places, which makes it easier to get outdated. Not necessarily. Documentation will be in whatever place we put it. Some places require tools to extract it. [...]