提交 d78a91af 编写于 作者: P Peter Krempa

qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion

Replace direct access to virJSONValue members by accessor.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 d4dd836e
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册