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

index b6c582aaca5e5f3dc00f4820f7625321cdc559b5..8df7aac93a7aa720d8969415b7cc79dec8d5821b 100644 (file)
@@ -790,10 +790,10 @@ qemuMigrationCapsToJSON(virBitmap *caps,
         if (!virBitmapIsBitSet(caps, bit))
             continue;
 
-        if (virJSONValueObjectCreate(&cap,
-                                     "s:capability", qemuMigrationCapabilityTypeToString(bit),
-                                     "b:state", virBitmapIsBitSet(states, bit),
-                                     NULL) < 0)
+        if (virJSONValueObjectAdd(&cap,
+                                  "s:capability", qemuMigrationCapabilityTypeToString(bit),
+                                  "b:state", virBitmapIsBitSet(states, bit),
+                                  NULL) < 0)
             return NULL;
 
         if (virJSONValueArrayAppend(json, &cap) < 0)