[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP |
Date: |
Tue, 28 Jan 2014 06:58:34 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
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
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v4 1/5] qapi: introduce DataObject to describe dynamic structs, (continued)
- [Qemu-devel] [PATCH v4 1/5] qapi: introduce DataObject to describe dynamic structs, Amos Kong, 2014/01/23
- [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Amos Kong, 2014/01/23
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Fam Zheng, 2014/01/24
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Fam Zheng, 2014/01/27
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Amos Kong, 2014/01/28
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Paolo Bonzini, 2014/01/28
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP,
Eric Blake <=
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Fam Zheng, 2014/01/29
- Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP, Amos Kong, 2014/01/27
[Qemu-devel] [PATCH v4 3/5] qobject: introduce qobject_get_str(), Amos Kong, 2014/01/23
[Qemu-devel] [PATCH v4 5/5] update docs/qmp-full-introspection.txt, Amos Kong, 2014/01/23
Re: [Qemu-devel] [PATCH v4 0/5] QMP full introspection, Amos Kong, 2014/01/24