[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP comman

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command
Date: Wed, 11 Mar 2015 11:21:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Cc'ing Amos, who grappled with this in the past.

Alberto Garcia <address@hidden> writes:

> On Fri, Mar 06, 2015 at 10:11:39AM -0700, Eric Blake wrote:
>> I'm still thinking about the actual patch, and whether we want
>> to commit to this or just bite the bullet and go for full
>> introspection.  At any rate, it's a bit late for 2.3, so we have the
>> full 2.4 cycle to get it right.
> I understand your concerns. 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'

Observe that we already have a machine-readable interface description:
the QAPI schema.  It's JSON, so we could have a query-schema return it
verbatim (minus the comments, of course).

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.  But first we need to address a number problems with the
exposed schema's syntax and semantics.

Introspection by exposing the QAPI schema makes schema syntax and
semantics an external interface.  Trouble is these are ill-defined.
We'd have to fix that (good idea anyway), and review the result with
compatible extensibility in mind.  Eric's stalled series "[PATCH v4
00/19] drop qapi nested structs" is a start:

The QAPI schema describes a union of internal interfaces and the
external QMP interface.  Unfortunate, because it makes the external
interface hard to see.  Naturally, QMP introspection should only expose
the QMP interface.  So we'd have to extract that part.

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.

Related prior work:
Amos's [PATCH v4 0/5] QMP full introspection
and the versions leading up to it, including the RFC

reply via email to

[Prev in Thread] Current Thread [Next in Thread]