From: Peter Krempa Date: Fri, 30 Mar 2018 08:40:51 +0000 (+0200) Subject: qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d78a91afee78d41d8677bc98412f6905fd66369a;p=libvirt.git qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion Replace direct access to virJSONValue members by accessor. Signed-off-by: Peter Krempa --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index f38d04f663..c94d2ef4b8 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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,