[libvirt] [PATCH 02/15] qemu: monitor: Add code to retrieve and store QMP schema data
Eric Blake
eblake at redhat.com
Thu Oct 20 18:44:00 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(+)
>
> +
> +virHashTablePtr
> +qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon)
> +{
> +
> + if (!(schema = virHashCreate(512, qemuMonitorJSONFreeSchemaEntry)))
> + goto cleanup;
> +
> + if (virJSONValueArrayForeachSteal(arr, qemuMonitorJSONFillQMPSchema,
> + schema) < 0)
For this usage, order indeed did not matter, but that may not be true
for all JSON arrays. Hence my comments on 1/15.
However, this patch looks fine. ACK
--
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/c3d934a9/attachment-0001.sig>
More information about the libvir-list
mailing list