[libvirt] [PATCH 02/15] qemu: monitor: Add code to retrieve and store QMP schema data

Eric Blake eblake at redhat.com
Thu Oct 20 19:37:47 UTC 2016


On 10/20/2016 10:24 AM, Peter Krempa wrote:
> Call 'query-qmp-schema' and store the returned types in a hash table
> keyed by the 'name' field so that the capabilities code can traverse it.
> ---
>  src/qemu/qemu_monitor.c      | 11 ++++++++
>  src/qemu/qemu_monitor.h      |  2 ++
>  src/qemu/qemu_monitor_json.c | 67 ++++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_monitor_json.h |  3 ++
>  4 files changed, 83 insertions(+)

Does qemu guarantee that the name field alone is unique?
/me rereads qemu/docs/qapi-code-gen.txt
"guaranteed that there will be no collisions between type, command, and
event names"

Okay. I was a bit worried that using name alone as the key would be
insufficient, and that you'd need a name/type pair. But it looks like
you should be fine, because qemu promises not to break things.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161020/90ec666a/attachment-0001.sig>


More information about the libvir-list mailing list