]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: monitor: Replace virJSONValueObjectCreate by virJSONValueObjectAdd
authorPeter Krempa <pkrempa@redhat.com>
Mon, 8 Nov 2021 16:24:50 +0000 (17:24 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 17 Nov 2021 11:04:11 +0000 (12:04 +0100)
virJSONValueObjectAdd now works identically to virJSONValueObjectCreate
when used with a NULL argument. Replace all callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c

index 398bef2e9675bf05b820f7be5ab555f91590600d..ac988e063ba7ffc79819c327f5326d73188bf021 100644 (file)
@@ -2880,10 +2880,10 @@ qemuMonitorCreateObjectProps(virJSONValue **propsret,
     int rc;
     va_list args;
 
-    if (virJSONValueObjectCreate(&props,
-                                 "s:qom-type", type,
-                                 "s:id", alias,
-                                 NULL) < 0)
+    if (virJSONValueObjectAdd(&props,
+                              "s:qom-type", type,
+                              "s:id", alias,
+                              NULL) < 0)
         return -1;
 
 
@@ -2961,11 +2961,11 @@ qemuMonitorAddObject(qemuMonitor *mon,
             *props = NULL;
         }
 
-        if (virJSONValueObjectCreate(&pr,
-                                     "s:qom-type", type,
-                                     "s:id", id,
-                                     "A:props", props,
-                                     NULL) < 0)
+        if (virJSONValueObjectAdd(&pr,
+                                  "s:qom-type", type,
+                                  "s:id", id,
+                                  "A:props", props,
+                                  NULL) < 0)
             return -1;
     }