mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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:
parent
d53be3fe93
commit
dd45aad40a
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user