From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: lcapitulino@redhat.com, armbru@redhat.com, stefanha@redhat.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QMP interface for drive-add (or even blockdev-add)
Date: Thu, 23 May 2013 16:41:43 +0200 [thread overview]
Message-ID: <20130523144142.GG3082@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <20130523115704.GG9093@stefanha-thinkpad.redhat.com>
Am 23.05.2013 um 13:57 hat Stefan Hajnoczi geschrieben:
> On Wed, May 22, 2013 at 03:53:05PM +0200, Kevin Wolf wrote:
> > Am 16.05.2013 um 21:05 hat Eric Blake geschrieben:
> > > On 05/16/2013 02:24 AM, Kevin Wolf wrote:
> > The other thing that I'm not sure about is whether we should teach QAPI
> > to parse certain data structures just into QDicts instead of C structs,
> > or if dealing with the big unions inside the block layer actually makes
> > sense.
>
> This is an interesting question. It's very convenient from the code
> side - we don't have to worry about laying down a schema.
>
> However, the point of QAPI is to offer that schema that allows for us to
> reason about things like compatibility (hard to sneak in a patch that
> modifies the schema, easy to sneak in a patch that modifies block driver
> parameter code) and eliminates the boilerplate of type-checking/basic
> input validation.
>
> Even if it requires some effort, I think we should avoid tunneling
> schema-less data over QAPI.
Note that I'm talking _only_ about the C side here. Everything that goes
through QMP is an external API and must described by a schema, I fully
agree there.
The question is whether QAPI must, after validating the input against
the schema, parse it into C structs or whether it should be able to fill
QDicts and pass those around.
Maybe it's just an unjustified feeling, but a C union of the option
structs for all image formats feels very ugly for me, whereas I think
a union is perfectly fine in the JSON schema.
Kevin
next prev parent reply other threads:[~2013-05-23 14:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5193AB0A.6090500@redhat.com>
[not found] ` <20130515155823.GG2858@dhcp-200-207.str.redhat.com>
[not found] ` <5193C93C.5060406@redhat.com>
2013-05-16 8:24 ` [Qemu-devel] QMP interface for drive-add (or even blockdev-add) Kevin Wolf
2013-05-16 19:05 ` Eric Blake
2013-05-22 13:53 ` Kevin Wolf
2013-05-23 11:57 ` Stefan Hajnoczi
2013-05-23 14:41 ` Kevin Wolf [this message]
2013-05-23 15:58 ` Stefan Hajnoczi
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=20130523144142.GG3082@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
/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).