Received: from eggs.gnu.org ([2001:4830:134:3::10]:37117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVj6K-0008Kd-M3 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 12:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVj6H-0004iR-CA for qemu-devel@nongnu.org; Wed, 11 Mar 2015 12:03:16 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:63292 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVj6H-0004af-1J for qemu-devel@nongnu.org; Wed, 11 Mar 2015 12:03:13 -0400 Date: Wed, 11 Mar 2015 17:02:28 +0100 From: Alberto Garcia Message-ID: <20150311160228.GA27897@igalia.com> References: <54F9DFCB.8000204@redhat.com> <20150311091809.GA13472@igalia.com> <874mprq1fs.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <874mprq1fs.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , qemu-devel@nongnu.org, Michael Roth , Luiz Capitulino , Amos Kong On Wed, Mar 11, 2015 at 11:21:43AM +0100, Markus Armbruster wrote: > > I can actually try to implement full introspection support, but I > > would like to know what API you would like. Something like this? > > > > 'query-commands' > > 'query-enums' > > 'query-events' > > 'query-types' > > 'query-unions' >=20 > You propose a separate query-FOO for each kind of thing in the > schema: command, event, the various types. Not fundamentally > different to a single query-schema. We can discuss which of the two > approaches is easier to use. I don't think it makes much difference in terms of complexity =66rom the QEMU side. I proposed those because query-commands and query-events already exist, so adding the missing ones seemed the most straightforward solution to me. But if query-schema is more convenient I don't have any problem with that. > Here's how I'd try to do that. Treat the schema as a graph, its > nodes are the definitions of types, commands and events are nodes, > and a use of a type adds an edge from the node containing the use to > the type. The external interface is exactly the sub-graph reachable > QMP command and event nodes. Makes sense. Berto