[libvirt] [PATCH 3/9] qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion

Peter Krempa posted 9 patches 7 years, 1 month ago
[libvirt] [PATCH 3/9] qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion
Posted by Peter Krempa 7 years, 1 month ago
Replace direct access to virJSONValue members by accessor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_monitor_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/9] qemu: monitor: Use virJSONValueObjectKeysNumber in qemuMonitorJSONGetCPUModelExpansion
Posted by Ján Tomko 7 years, 1 month ago
On Fri, Mar 30, 2018 at 12:59:10PM +0200, Peter Krempa wrote:
>Replace direct access to virJSONValue members by accessor.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_monitor_json.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

ACK

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