qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC/RFA PATCH] qapi: detect extra members inside structs
Date: Tue, 20 Mar 2012 09:15:50 -0300	[thread overview]
Message-ID: <20120320091550.35959dc5@doriath.home> (raw)
In-Reply-To: <4F67D42A.8080400@codemonkey.ws>

On Mon, 19 Mar 2012 19:49:46 -0500
Anthony Liguori <anthony@codemonkey.ws> wrote:

> On 03/19/2012 06:45 PM, Michael Roth wrote:
> >>> So IMO, returning arguments actually seems easier for both clients and the
> >>> server, and is more resilient to downstream changes. It does require a more
> >>> formal specification of the protocol though. Basically: "an option/field
> >>> may not be supported in older/future versions of QEMU, so it is up to
> >>> the client to check in advance by referencing the QAPI schema for their
> >>> qemu version or programatically via get_schema(<command>)"
> >>
> >> The complexity of writing a client using get_schema() is close to staggering :-/
> >
> > I'm not sure, I mean, take libvirt, you need to marshall up the
> > arguments anyway and put them into a QMP payload, so in that case the
> > client developer is aware of the schema that they're coding against,
> > and also understand the QAPI schema specification, and if the schema
> > is nested then so is the client version of that "schema".
> >
> > So, conceptually at least, it seems like it wouldn't be that big a jump
> > to maintain an internal representation of their schema to
> > programatically check against the specification they were coding
> > against, it's just the part where they then need to bake it into the
> > client implementation that's a bit heavy-handed.
> 
> So let's work through a few examples.   Today, you have to maintain a list of 
> commands returned from query-commands and check for set membership:
> 
> if 'query-netdev2' in commands:
>     qmp.query_netdev2(foo)
> else:
>     qmp.query_netdev()
> 
> Pretty simple.  If we have a schema representation, we'll need to be able to 
> check for arguments.

Aren't we going to have the schema representation anyway? Or if we go for the
way above we are not going to have it?

  reply	other threads:[~2012-03-20 12:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 19:29 [Qemu-devel] [RFC/RFA PATCH] qapi: detect extra members inside structs Paolo Bonzini
2012-03-19 19:34 ` Anthony Liguori
2012-03-19 19:51   ` Paolo Bonzini
2012-03-19 19:56     ` Anthony Liguori
2012-03-19 20:22       ` Eric Blake
2012-03-19 20:30         ` Anthony Liguori
2012-03-19 20:43           ` Luiz Capitulino
2012-03-19 22:29             ` Michael Roth
2012-03-19 22:38               ` Anthony Liguori
2012-03-19 23:45                 ` Michael Roth
2012-03-20  0:49                   ` Anthony Liguori
2012-03-20 12:15                     ` Luiz Capitulino [this message]
2012-03-20 19:33                       ` Anthony Liguori
2012-03-20 17:31       ` Paolo Bonzini
2012-03-20  0:28 ` Michael Roth

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=20120320091550.35959dc5@doriath.home \
    --to=lcapitulino@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.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).