qemu: Remove stale transient def when migration fails

If a migration of a domain which is already defined on the destination
host failed early (before we tried to start QEMU), we would forget to
remove the incoming transient definition. Later on when someone starts
the domain on the destination host, we will use the stale incoming
definition and the persistent definition will just be ignored.

https://bugzilla.redhat.com/show_bug.cgi?id=1368774

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-09-08 15:22:28 +02:00
parent 97a87333a0
commit 66278d4bc3

View File

@ -3872,6 +3872,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
if (nbdPort == 0) if (nbdPort == 0)
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
priv->nbdPort = 0; priv->nbdPort = 0;
virDomainObjRemoveTransientDef(vm);
qemuDomainRemoveInactive(driver, vm); qemuDomainRemoveInactive(driver, vm);
} }
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);