diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2cd862875cce6392cc53a7a172f3d50ada451799..40564ac63a4306ab59a176bf319c366d2c6565ef 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;