render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From dd980e5643963822af2eccc5548e7b53f21576b6 Mon Sep 17 00:00:00 2001
Message-Id: <dd980e5643963822af2eccc5548e7b53f21576b6@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Thu, 8 Sep 2016 15:22:28 +0200
Subject: [PATCH] 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>
(cherry picked from commit 66278d4bc38aecff6661c91ce9cd3fff26e54a91)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_migration.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ae70f2a..537bfeb 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3876,6 +3876,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
         if (nbdPort == 0)
             virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
         priv->nbdPort = 0;
+        virDomainObjRemoveTransientDef(vm);
         qemuDomainRemoveInactive(driver, vm);
     }
     virDomainObjEndAPI(&vm);
-- 
2.10.0