render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
3e5111
From 81d8546556f74d0052cbe2a2c3287bc9d796bf32 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <81d8546556f74d0052cbe2a2c3287bc9d796bf32@dist-git>
3e5111
From: Jiri Denemark <jdenemar@redhat.com>
3e5111
Date: Thu, 27 Apr 2017 14:08:40 +0200
3e5111
Subject: [PATCH] qemu: Properly reset non-p2p migration
3e5111
3e5111
While peer-to-peer migration enters the Confirm phase even if the
3e5111
Perform phase fails, the client which initiated a non-p2p migration will
3e5111
never call virDomainMigrateConfirm* API if the Perform phase failed.
3e5111
Thus we need to explicitly reset migration before reporting a failure
3e5111
from the Perform phase API.
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1425003
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
(cherry picked from commit eeb2feb9fbb66ea9026edc6451018fb3b94ffa58)
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_migration.c | 7 +++++--
3e5111
 1 file changed, 5 insertions(+), 2 deletions(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
3e5111
index 8c6d1385e..8cbad894c 100644
3e5111
--- a/src/qemu/qemu_migration.c
3e5111
+++ b/src/qemu/qemu_migration.c
3e5111
@@ -4902,10 +4902,13 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver,
3e5111
         goto endjob;
3e5111
 
3e5111
  endjob:
3e5111
-    if (ret < 0)
3e5111
+    if (ret < 0) {
3e5111
+        qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT);
3e5111
         qemuMigrationJobFinish(driver, vm);
3e5111
-    else
3e5111
+    } else {
3e5111
         qemuMigrationJobContinue(vm);
3e5111
+    }
3e5111
+
3e5111
     if (!virDomainObjIsActive(vm))
3e5111
         qemuDomainRemoveInactive(driver, vm);
3e5111
 
3e5111
-- 
3e5111
2.12.2
3e5111