[PATCH 14/18] virsh: domain: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

Peter Krempa pkrempa at redhat.com
Mon Nov 15 14:22:13 UTC 2021


virJSONValueObjectAdd now works identically to virJSONValueObjectCreate
when used with a NULL argument. Replace all callers.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tools/virsh-domain.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 22f428f702..e9b49307db 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9623,10 +9623,10 @@ cmdQemuMonitorCommandQMPWrap(vshControl *ctl,
         }
     }

-    if (virJSONValueObjectCreate(&command,
-                                 "s:execute", commandname,
-                                 "A:arguments", &arguments,
-                                 NULL) < 0)
+    if (virJSONValueObjectAdd(&command,
+                              "s:execute", commandname,
+                              "A:arguments", &arguments,
+                              NULL) < 0)
         return NULL;

     return virJSONValueToString(command, false);
-- 
2.31.1




More information about the libvir-list mailing list