]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Remove stale transient def when migration fails
authorJiri Denemark <jdenemar@redhat.com>
Thu, 8 Sep 2016 13:22:28 +0000 (15:22 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 8 Sep 2016 20:25:22 +0000 (22:25 +0200)
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>
src/qemu/qemu_migration.c

index e451ef6f876b5e0ac89c3a48282300e7bd9b13ba..07f18db635cc5de79f25c8fe95baa1e9d37416ac 100644 (file)
@@ -3872,6 +3872,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
         if (nbdPort == 0)
             virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
         priv->nbdPort = 0;
+        virDomainObjRemoveTransientDef(vm);
         qemuDomainRemoveInactive(driver, vm);
     }
     virDomainObjEndAPI(&vm);