From: Kevin Wolf <kwolf@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com,
qiaonuohan@cn.fujitsu.com, pbonzini@redhat.com,
Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] full introspection support for QMP
Date: Wed, 3 Jul 2013 17:08:07 +0200 [thread overview]
Message-ID: <20130703150807.GC2784@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <87a9m4j3i7.fsf@codemonkey.ws>
Am 02.07.2013 um 19:06 hat Anthony Liguori geschrieben:
> Eric Blake <eblake@redhat.com> writes:
> > On 07/02/2013 08:51 AM, Anthony Liguori wrote:
> >> Amos Kong <akong@redhat.com> writes:
> >>
> >>> Introduces new monitor command to query QMP schema information,
> >>> the return data is a nested dict/list, it contains the useful
> >>> metadata.
> >>>
> >>> we can add events definations to qapi-schema.json, then it can
> >>> also be queried.
> >>>
> >>> Signed-off-by: Amos Kong <akong@redhat.com>
> >>
> >> Maybe I'm being too meta here, but why not just return qapi-schema.json
> >> as a string and call it as day?
I know you don't agree with this, but as I mentioned several times
before, I think the schema as returned by the introspection functions
shouldn't contain what a qemu of this version _could_ in theory provide,
but what this specific build actually _does_ provide. It shouldn't
include things that are compiled out.
> > I've also been the one arguing that the additional complexity (an array of
> > {"name":"str","type":"str","optional":bool"}) is better for libvirt in
> > that the JSON is then well-suited for scanning (it is easier to scan
> > through an array where the key is a constant "name", and looking for the
> > value that we are interested in, than it is to scan through a dictionary
> > where the keys of the dictionary are the names we are interested in).
> > That is, the JSON in qapi-schema.json is a nice compact representation
> > that works for humans, but may be a bit TOO compact for handling via
> > machines.
>
> But adding a bunch of code to do JSON translation just adds a bunch of
> additional complexity.
>
> One reasonable compromise would be:
>
> { "command": "foo", "arguments": { "name": "str", "id": "int" },
> "optional": { "bar": "bool" } }
This assumes that optional vs. mandatory is the only property we ever
want to describe for fields. Eric's approach is much more future-proof.
Let's keep the format of qapi-schema.json an implementation detail that
we can change and extend when necessary.
Kevin
next prev parent reply other threads:[~2013-07-03 15:08 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 12:24 [Qemu-devel] [PATCH] full introspection support for QMP Amos Kong
2013-06-19 12:49 ` Amos Kong
2013-06-20 10:16 ` Amos Kong
2013-07-02 16:39 ` Eric Blake
2013-06-21 3:20 ` Luiz Capitulino
2013-07-02 8:37 ` Amos Kong
2013-07-02 14:20 ` Luiz Capitulino
2013-07-16 10:52 ` Amos Kong
2013-07-02 14:51 ` Anthony Liguori
2013-07-02 15:28 ` Eric Blake
2013-07-02 15:39 ` Daniel P. Berrange
2013-07-02 16:44 ` Eric Blake
2013-07-02 17:01 ` Paolo Bonzini
2013-07-02 17:06 ` Eric Blake
2013-07-02 18:27 ` Anthony Liguori
2013-07-04 3:54 ` Amos Kong
2013-07-02 18:21 ` Anthony Liguori
2013-07-02 20:00 ` Paolo Bonzini
2013-07-02 20:08 ` Eric Blake
2013-07-02 20:58 ` Anthony Liguori
2013-07-03 5:52 ` Paolo Bonzini
2013-07-03 12:54 ` Anthony Liguori
2013-07-03 14:45 ` Paolo Bonzini
2013-07-03 16:06 ` Anthony Liguori
2013-07-04 7:53 ` Paolo Bonzini
2013-07-11 13:37 ` Amos Kong
2013-07-02 17:06 ` Anthony Liguori
2013-07-02 17:11 ` Eric Blake
2013-07-02 18:28 ` Anthony Liguori
2013-07-03 15:08 ` Kevin Wolf [this message]
2013-07-03 15:59 ` Anthony Liguori
2013-07-04 7:42 ` Kevin Wolf
2013-07-04 7:55 ` Paolo Bonzini
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=20130703150807.GC2784@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qiaonuohan@cn.fujitsu.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).