]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Always send persistent XML during migration
authorJiri Denemark <jdenemar@redhat.com>
Wed, 7 Jun 2017 07:35:25 +0000 (09:35 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 7 Jun 2017 11:36:02 +0000 (13:36 +0200)
When persistent migration of a transient domain is requested but no
custom XML is passed to the migration API we would just let the
destination daemon make a persistent definition from the live definition
itself. This is not a problem now, but once the destination daemon
starts replacing the original CPU definition with the one from migration
cookie before starting a domain, it would need to add more ugly hacks to
reverse the operation. Let's just always send the persistent definition
in the cookie to make things a bit cleaner.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_migration.c

index 2cd862875cce6392cc53a7a172f3d50ada451799..40564ac63a4306ab59a176bf319c366d2c6565ef 100644 (file)
@@ -3644,8 +3644,9 @@ qemuMigrationRun(virQEMUDriverPtr driver,
             if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml,
                                                        NULL, NULL)))
                 goto cleanup;
-        } else if (vm->newDef) {
-            if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef,
+        } else {
+            virDomainDefPtr def = vm->newDef ? vm->newDef : vm->def;
+            if (!(persistDef = qemuDomainDefCopy(driver, def,
                                                  VIR_DOMAIN_XML_SECURE |
                                                  VIR_DOMAIN_XML_MIGRATABLE)))
                 goto cleanup;