]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMigrationCookieNBDXMLFormat: Format empty <nbd/> element
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Apr 2021 14:16:44 +0000 (16:16 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Apr 2021 15:22:30 +0000 (17:22 +0200)
Commit 518be41aaa3 refactored qemuMigrationCookieNBDXMLFormat to use
virXMLFormatElement which in comparison to the previous code doesn't
format the element if it's empty.

Unfortunately some crusty bits of our migration code use questionable
logic to assert use of the old-style storage migration parameters which
breaks if no disks are being migrated and the <nbd/> element is not
present.

While later patches will fix the code, re-instate formatting of empty
<nbd/> for increased compatibility.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration_cookie.c

index 41533e45498c3b815d58c527ef43d78fe5f8fbab..52998ddd1b7a9a27b54ba9986148ec2cfd360310 100644 (file)
@@ -790,7 +790,7 @@ qemuMigrationCookieNBDXMLFormat(qemuMigrationCookieNBD *nbd,
         virBufferAsprintf(&childBuf, " capacity='%llu'/>\n", nbd->disks[i].capacity);
     }
 
-    virXMLFormatElement(buf, "nbd", &attrBuf, &childBuf);
+    virXMLFormatElementEmpty(buf, "nbd", &attrBuf, &childBuf);
 }