On Thu, Sep 08, 2016 at 16:21:04 +0200, Jiri Denemark wrote:
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(a)redhat.com>
---
src/qemu/qemu_migration.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e451ef6..6ef2396 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3874,6 +3874,10 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
priv->nbdPort = 0;
qemuDomainRemoveInactive(driver, vm);
}
+
+ if (ret < 0)
+ virDomainObjRemoveTransientDef(vm);
This needs to go to the block above. 'priv' is set if the domain def was
assigned (basically after virDomainObjListAdd) succeeded. Currently it
would crash if the target VM would be running. 'priv' basically
guarantees that 'vm' is valid.
ACK if you move this into the block above.