From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfDHM-0005Xo-Rr for qemu-devel@nongnu.org; Wed, 22 May 2013 13:56:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfDHH-0005mA-FN for qemu-devel@nongnu.org; Wed, 22 May 2013 13:56:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfDHH-0005m1-4K for qemu-devel@nongnu.org; Wed, 22 May 2013 13:56:43 -0400 Date: Wed, 22 May 2013 13:56:40 -0400 From: Luiz Capitulino Message-ID: <20130522135640.133d02bf@redhat.com> In-Reply-To: <20130522134007.GA2051@t430s.nay.redhat.com> References: <20130522134007.GA2051@t430s.nay.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] RFC: Full introspection support for QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, Ronen Hod , qemu-devel , Markus Armbruster On Wed, 22 May 2013 21:40:07 +0800 Amos Kong wrote: > Hi all, > > We already have query-command-line-options to query details of command-line > options. As we discussed in the list, we also need full introspection of QMP > (command). The qmp-events also need to be dumped, we can define events in > qai-schema.json. We can also dump QMP errors in future if it's needed. > > Command name: query-qmp-schema > Return: returns the contents of qapi-schema.json in json format. > > Solution to query json content from C code: > qapi-schema.json is processed by qapi python scripts to generate C > files, I found the content is good enough for Libvirt to know the > QMP command schema. We can change qapi scripts to generate a talbe/list > to record the raw string, then we can return the raw string in > qmp_query_qmp_schema(). > > By default, return the complete schema in one go. > > And support to query of unknown type in new command. > -> { "execute": "query-qmp-schema" "arguments": { "command": "query-status" }} > <- { "return" : "data": { "command': "query-status", "returns": "StatusInfo" }} > -> { "execute": "query-qmp-schema" "arguments": { "type": "StatusInfo" }} > <- { "return" : "data": { "type": "StatusInfo", "data": {"running": "bool", > "singlestep": "bool", "status": "RunState"} } Looks good, but as Kevin said an example of the schema output would be good. Feel free to post patches along :) > -> { "execute": "query-qmp-schema" "arguments": { "event": "RX-FILTER-CHANGE" }} You'll need to add the events to the schema some way. I'm not sure I'd mix the projects in the same series, maybe you could add event support to the schema after query-qmp-schema gets merged. > > > Welcome your comments, thanks! > > > Target: 1.6 > Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=557939 >