qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>,
	qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command
Date: Wed, 11 Mar 2015 11:39:06 +0100	[thread overview]
Message-ID: <20150311103906.GD6628@noname.str.redhat.com> (raw)
In-Reply-To: <874mprq1fs.fsf@blackfin.pond.sub.org>

Am 11.03.2015 um 11:21 hat Markus Armbruster geschrieben:
> Cc'ing Amos, who grappled with this in the past.
> 
> Alberto Garcia <berto@igalia.com> 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).

It's an awful structure for an external interface.

Things like designating optional fields with *name are great for humans
because they allow concise definitions where each field is just one dict
entry instead of a whole struct, and this keeps things readable.

This is important for the schema as it doesn't only serve as the source
for the code generator, but is edited by humans and used as an API
documentation. So we want to keep that.

But I'm pretty sure we don't want to send it as part of an external API.

> 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:
> https://lists.nongnu.org/archive/html/qemu-devel/2014-09/msg04022.html

Cleanups on the surface won't change any of the points above. I'm not
convinced that the schema could be friendly for humans and suitable as
an external API at the same time.

> 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.

Yes, that's how I would do it, too.

Kevin

  reply	other threads:[~2015-03-11 10:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 13:51 [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command Alberto Garcia
2015-02-24 13:51 ` [Qemu-devel] [PATCH 1/1] qmp: Add support for requesting the list of arguments from a command Alberto Garcia
2015-03-06 17:11 ` [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command Eric Blake
2015-03-11  9:18   ` Alberto Garcia
2015-03-11 10:21     ` Markus Armbruster
2015-03-11 10:39       ` Kevin Wolf [this message]
2015-03-11 16:02       ` Alberto Garcia
2015-03-11 19:22         ` Markus Armbruster
2015-03-12 12:39           ` Kevin Wolf
2015-03-14 16:12             ` Markus Armbruster
2015-04-01 15:02               ` Alberto Garcia
2015-04-01 15:30                 ` Markus Armbruster
2015-03-11 10:26   ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150311103906.GD6628@noname.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).