[PATCH 08/18] qemu: migration_cookie: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_migration_cookie.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index cc4cc39b32..eaf360932d 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -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)
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux