qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, Amos Kong <akong@redhat.com>,
	Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, libvir-list@redhat.com,
	mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com,
	qiaonuohan@cn.fujitsu.com, xiawenc@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP
Date: Tue, 28 Jan 2014 06:58:34 -0700	[thread overview]
Message-ID: <52E7B78A.8000102@redhat.com> (raw)
In-Reply-To: <52E79132.1030705@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

On 01/28/2014 04:14 AM, Paolo Bonzini wrote:

>> Let's see the feedback of Eric.
> 
> Eric's feedback is certainly useful, but I think we need to look at it
> from the QEMU perspective more than the libvirt perspective.
> 
> Passing the raw schema and letting libvirt parse it is a Really Bad idea
> from the QEMU perspective, in my opinion, even if it means a little more
> work now and even if libvirt is willing to add the parser.

Libvirt wants to parse formal qapi, not pseudo-JSON.  I still have on my
to-do list to read the v4 schema and make sure that libvirt can live
with it.

> 
> First and foremost, the current "pseudo-JSON" encoding of the schema is
> nothing but a QEMU implementation detail.  The "pseudo-JSON" syntax
> definitely shouldn't percolate to the QAPI documentation.  Using normal
> QAPI structs means that the normal tool for documentation
> (qapi-schema.json doc comments) applies just as well to QAPI schema
> introspection

Agreed - I definitely want the output of the query command to be fully
described by qapi.  Which means we DO have to convert from the
pseudo-JSON of the qapi file into the final formal qapi format.  But the
conversion is known at code generation time, so you should do it as part
of your python code generator, and not repeat the conversion at runtime
in the C code.  That is, the C code should have everything already split
out into the data structures it needs to just output the qapi structure
as documented for the formal qapi definition.

> 
> Second, if one day we were to change the schema representation from
> "pseudo-JSON" to something else, we would have to carry a "pseudo-JSON"
> serializer for backwards compatibility.  Building QAPI structs and
> relying on the normal formatting machinery is very different from
> putting together strings manually.
> 
> The schema must be emitted as JSON data, not as a string.  I'm not
> willing to compromise on this point. :)

Nor am I.  The output MUST be formal JSON, described by the qapi
(whether we change the syntax of qapi-schema.json and tweak the .py code
generators in the future should not matter, the output of the QMP
command will be the same formal JSON).

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-01-28 13:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 14:46 [Qemu-devel] [PATCH v4 0/5] QMP full introspection Amos Kong
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 1/5] qapi: introduce DataObject to describe dynamic structs Amos Kong
2014-02-03 19:56   ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 2/5] qapi: add qapi-introspect.py code generator Amos Kong
2014-01-24  9:12   ` Fam Zheng
2014-01-24  9:34     ` Amos Kong
2014-01-26  4:51       ` Amos Kong
2014-02-04  0:15   ` Eric Blake
2014-02-11  0:35     ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 3/5] qobject: introduce qobject_get_str() Amos Kong
2014-02-04  0:20   ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP Amos Kong
2014-01-24 10:48   ` Fam Zheng
2014-01-27  8:17     ` Amos Kong
2014-01-27  8:50       ` Amos Kong
2014-01-27  9:38       ` Paolo Bonzini
2014-01-27 10:07         ` Amos Kong
2014-01-27 10:15           ` Paolo Bonzini
2014-01-27 10:46         ` Fam Zheng
2014-01-28 10:45           ` Amos Kong
2014-01-28 11:14             ` Paolo Bonzini
2014-01-28 13:58               ` Eric Blake [this message]
2014-01-29  8:12                 ` Fam Zheng
2014-02-04  0:33   ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 5/5] update docs/qmp-full-introspection.txt Amos Kong
2014-01-24 11:43   ` Paolo Bonzini
2014-01-24 13:07     ` Eric Blake
2014-01-24  8:42 ` [Qemu-devel] [PATCH v4 0/5] QMP full introspection Amos Kong

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=52E7B78A.8000102@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=famz@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=xiawenc@linux.vnet.ibm.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).