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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]