[libvirt] [PATCH] qemu: Properly reset non-p2p migration

Jiri Denemark posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1cddb9293420920cb774eef525bed6a8f799e4f3.1493236718.git.jdenemar@redhat.com
src/qemu/qemu_migration.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
[libvirt] [PATCH] qemu: Properly reset non-p2p migration
Posted by Jiri Denemark 6 years, 11 months ago
While peer-to-peer migration enters the Confirm phase even if the
Perform phase fails, the client which initiated a non-p2p migration will
never call virDomainMigrateConfirm* API if the Perform phase failed.
Thus we need to explicitly reset migration before reporting a failure
from the Perform phase API.

https://bugzilla.redhat.com/show_bug.cgi?id=1425003

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_migration.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 09adb0484..42da706c9 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4914,10 +4914,13 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver,
         goto endjob;
 
  endjob:
-    if (ret < 0)
+    if (ret < 0) {
+        qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT);
         qemuMigrationJobFinish(driver, vm);
-    else
+    } else {
         qemuMigrationJobContinue(vm);
+    }
+
     if (!virDomainObjIsActive(vm))
         qemuDomainRemoveInactive(driver, vm);
 
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Properly reset non-p2p migration
Posted by Peter Krempa 6 years, 11 months ago
On Wed, Apr 26, 2017 at 21:58:38 +0200, Jiri Denemark wrote:
> While peer-to-peer migration enters the Confirm phase even if the
> Perform phase fails, the client which initiated a non-p2p migration will
> never call virDomainMigrateConfirm* API if the Perform phase failed.
> Thus we need to explicitly reset migration before reporting a failure
> from the Perform phase API.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1425003
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/qemu/qemu_migration.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

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