qemu-devel
[Top][All Lists]
Advanced

[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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP
Date: Tue, 28 Jan 2014 12:14:58 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 28/01/2014 11:45, Amos Kong ha scritto:
> My question is why is this generate-and-parse necessary?

It's request of Libvirt, actually we can directly return the raw
schema to Libvirt without extending/parsing, then Libvirt parse
by itself.

> Can we achieve it with less duplication?

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.

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

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. :)

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]