qemu: migration_cookie: Replace virJSONValueObjectCreate by virJSONValueObjectAdd

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>
This commit is contained in:
Peter Krempa 2021-11-08 17:24:50 +01:00
parent d53be3fe93
commit dd45aad40a

View File

@ -1623,12 +1623,13 @@ 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,
if (virJSONValueObjectAdd(&jsonbitmap,
"s:name", bitmapname,
"s:alias", bitmap->alias,
"A:transform", &transform,
@ -1644,7 +1645,7 @@ qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks,
if (!hasBitmaps)
continue;
if (virJSONValueObjectCreate(&jsondisk,
if (virJSONValueObjectAdd(&jsondisk,
"s:node-name", disk->nodename,
"s:alias", disk->target,
"a:bitmaps", &jsonbitmaps,