]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion
authorPeter Krempa <pkrempa@redhat.com>
Fri, 30 Mar 2018 08:40:51 +0000 (10:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Apr 2018 11:34:33 +0000 (13:34 +0200)
Replace direct access to virJSONValue members by accessor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_monitor_json.c

index f38d04f663dd1f22fcd40b3825a2cda410c638f3..c94d2ef4b898bc98cec8a7029a52651d738b0629 100644 (file)
@@ -5443,7 +5443,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
     if (VIR_STRDUP(machine_model->name, cpu_name) < 0)
         goto cleanup;
 
-    if (VIR_ALLOC_N(machine_model->props, cpu_props->data.object.npairs) < 0)
+    if (VIR_ALLOC_N(machine_model->props, virJSONValueObjectKeysNumber(cpu_props)) < 0)
         goto cleanup;
 
     if (virJSONValueObjectForeachKeyValue(cpu_props,