qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Eric Blake <eblake@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: mdroth <mdroth@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, armbru@redhat.com, lcapitulino@redhat.com,
	qiaonuohan@cn.fujitsu.com, Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] full introspection support for QMP
Date: Tue, 02 Jul 2013 13:27:32 -0500	[thread overview]
Message-ID: <87d2r0om0b.fsf@codemonkey.ws> (raw)
In-Reply-To: <51D308A1.7080604@redhat.com>

Eric Blake <eblake@redhat.com> writes:

> On 07/02/2013 11:01 AM, Paolo Bonzini wrote:
>>>> Arguably that rule of thumb would apply equally to the QEMU
>>>> build scripts which already parse qapi-schema.json. It could
>>>> be possible to normalize qapi-schema.json somewhat to remove
>>>> this 2-stage parsing if we went down this route.
>>>
>>> Indeed, I wouldn't mind a one-time pass over qapi-schema.json to make it
>>> follow a more rigid format if that made it easier to use it as-is with
>>> less post-processing.  It won't be very nice to backport such a
>>> conversion, but I don't know how much distros are planning on
>>> backporting introspection in the first place.
>> 
>> How would the schema look like after this "one-time pass"?
>> 
>> This:
>> 
>>> [
>>>          { "name": "protocol",
>>>            "type": "str" },
>>>          { "name": "fdname",
>>>            "type": "str" },
>>>          { "name": "skipauth",
>>>            "type": "bool",
>>>            "optional": true },
>>>          { "name": "tls",
>>>            "type": "bool",
>>>            "optional": true }
>>> ]
>> 
>> Looks quite awful for a human to write and read.
>
> Which puts us back in favor of my original argument that keeping
> qapi-schema.json compact for human use,

qapi-schema.json is not "for human use".  It's consumed by QAPI.  It
happens to be reasonably human readable but that's just a happy
coincidence and because we document and format the heck out of it.

> while expanding the QMP output
> to be verbose for machine use, is probably what we'll have to live with.
>  While it is easy to document shortcuts that the qapi parser can use
> when converting .json to code, it is harder to require that all other
> QMP clients must implement those same shortcuts, instead of having
> things already directly represented.

qapi-schema.json is valid JSON except for the # style comments.  Those
are trivial to remove and we could simply post process it.

Heck, if you use json_parser to parse the file, you'd end up with a list
of QObjects that could be returned directly via QMP.

I don't understand what all this talk of "post-processing" is.

Regards,

Anthony Liguori

>
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org

  reply	other threads:[~2013-07-02 18:29 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 [this message]
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
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=87d2r0om0b.fsf@codemonkey.ws \
    --to=aliguori@us.ibm.com \
    --cc=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.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).