From: Jiri Denemark Date: Wed, 7 Jun 2017 07:35:25 +0000 (+0200) Subject: qemu: Always send persistent XML during migration X-Git-Tag: v3.5.0-rc1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0a16641fa648de23d1fd05a3e89987799550c44;p=thirdparty%2Flibvirt.git qemu: Always send persistent XML during migration 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 Reviewed-by: Pavel Hrdina --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2cd862875c..40564ac63a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -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;