3e5111
From d3df2456cfc82cba6afdb2f44dca91f6f553ac76 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <d3df2456cfc82cba6afdb2f44dca91f6f553ac76@dist-git>
3e5111
From: Jiri Denemark <jdenemar@redhat.com>
3e5111
Date: Wed, 7 Jun 2017 09:35:25 +0200
3e5111
Subject: [PATCH] qemu: Always send persistent XML during migration
3e5111
3e5111
When persistent migration of a transient domain is requested but no
3e5111
custom XML is passed to the migration API we would just let the
3e5111
destination daemon make a persistent definition from the live definition
3e5111
itself. This is not a problem now, but once the destination daemon
3e5111
starts replacing the original CPU definition with the one from migration
3e5111
cookie before starting a domain, it would need to add more ugly hacks to
3e5111
reverse the operation. Let's just always send the persistent definition
3e5111
in the cookie to make things a bit cleaner.
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3e5111
(cherry picked from commit b0a16641fa648de23d1fd05a3e89987799550c44)
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1441662
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_migration.c | 5 +++--
3e5111
 1 file changed, 3 insertions(+), 2 deletions(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
3e5111
index ec5af7a612..a7c90a09e8 100644
3e5111
--- a/src/qemu/qemu_migration.c
3e5111
+++ b/src/qemu/qemu_migration.c
3e5111
@@ -3613,8 +3613,9 @@ qemuMigrationRun(virQEMUDriverPtr driver,
3e5111
             if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml,
3e5111
                                                        NULL, NULL)))
3e5111
                 goto cleanup;
3e5111
-        } else if (vm->newDef) {
3e5111
-            if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef,
3e5111
+        } else {
3e5111
+            virDomainDefPtr def = vm->newDef ? vm->newDef : vm->def;
3e5111
+            if (!(persistDef = qemuDomainDefCopy(driver, def,
3e5111
                                                  VIR_DOMAIN_XML_SECURE |
3e5111
                                                  VIR_DOMAIN_XML_MIGRATABLE)))
3e5111
                 goto cleanup;
3e5111
-- 
3e5111
2.13.1
3e5111