[PATCH 3/3] libxl: destroy domain in migration finish phase on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The 'cleanup' label was missplaced in libxlDomainMigrationFinish,
causing a migrated domain to remain if the migration was cancelled
or encountered an error during perform phase.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_migration.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 260b247..0a41568 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -539,16 +539,17 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
                                          VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
     }
 
-    if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
-        goto cleanup;
-
     if (event) {
         libxlDomainEventQueue(driver, event);
         event = NULL;
     }
 
+    if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
+        goto cleanup;
+
     dom = virGetDomain(dconn, vm->def->name, vm->def->uuid);
 
+ cleanup:
     if (dom == NULL) {
         libxl_domain_destroy(priv->ctx, vm->def->id, NULL);
         libxlDomainCleanup(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED);
@@ -556,7 +557,6 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
                                          VIR_DOMAIN_EVENT_STOPPED_FAILED);
     }
 
- cleanup:
     if (event)
         libxlDomainEventQueue(driver, event);
     virObjectUnlock(vm);
-- 
1.8.4.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]