From dd45aad40a88fcb228730fa116b30b32d8db93e1 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 8 Nov 2021 17:24:50 +0100 Subject: [PATCH] qemu: migration_cookie: Replace virJSONValueObjectCreate by virJSONValueObjectAdd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virJSONValueObjectAdd now works identically to virJSONValueObjectCreate when used with a NULL argument. Replace all callers. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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)