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