qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion

Replace direct access to virJSONValue members by accessor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-03-30 10:40:51 +02:00
parent d4dd836edc
commit d78a91afee

View 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,