]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: migration_cookie: 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_migration_cookie.c

index cc4cc39b32690ec727f9aece15276680b34146a0..eaf360932da7df6294ce40600f1c221392f16352 100644 (file)
@@ -1623,16 +1623,17 @@ qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks,
                 bitmapname = bitmap->bitmapname;
 
             if (bitmap->persistent == VIR_TRISTATE_BOOL_YES) {
-                if (virJSONValueObjectCreate(&transform,
-                                             "b:persistent", true, NULL) < 0)
+                if (virJSONValueObjectAdd(&transform,
+                                          "b:persistent", true,
+                                          NULL) < 0)
                     return -1;
             }
 
-            if (virJSONValueObjectCreate(&jsonbitmap,
-                                         "s:name", bitmapname,
-                                         "s:alias", bitmap->alias,
-                                         "A:transform", &transform,
-                                         NULL) < 0)
+            if (virJSONValueObjectAdd(&jsonbitmap,
+                                      "s:name", bitmapname,
+                                      "s:alias", bitmap->alias,
+                                      "A:transform", &transform,
+                                      NULL) < 0)
                 return -1;
 
             if (virJSONValueArrayAppend(jsonbitmaps, &jsonbitmap) < 0)
@@ -1644,11 +1645,11 @@ qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks,
         if (!hasBitmaps)
             continue;
 
-        if (virJSONValueObjectCreate(&jsondisk,
-                                     "s:node-name", disk->nodename,
-                                     "s:alias", disk->target,
-                                     "a:bitmaps", &jsonbitmaps,
-                                     NULL) < 0)
+        if (virJSONValueObjectAdd(&jsondisk,
+                                  "s:node-name", disk->nodename,
+                                  "s:alias", disk->target,
+                                  "a:bitmaps", &jsonbitmaps,
+                                  NULL) < 0)
             return -1;
 
         if (virJSONValueArrayAppend(map, &jsondisk) < 0)