[pve-devel] [PATCH v2 qemu-server 16/16] cancel_migrate: move block-job-cancel

Alexandre Derumier aderumier at odiso.com
Mon Mar 9 16:24:39 CET 2020


Seem than block-job-cancel was done after the lock release,
we need to do it before

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuMigrate.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index f8061cf..4b2bb0b 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -577,11 +577,6 @@ sub phase2_cleanup {
     # cleanup ressources on target host
     if ($self->{storage_migration}) {
 
-	eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $self->{storage_migration_jobs}) };
-	if (my $err = $@) {
-	    $self->log('err', $err);
-	}
-
 	eval { PVE::QemuMigrate::cleanup_remotedisks($self) };
 	if (my $err = $@) {
 	    $self->log('err', $err);
@@ -1015,6 +1010,13 @@ sub cancel_migrate {
 	mon_cmd($vmid, "migrate_cancel");
     };
     $self->log('info', "migrate_cancel error: $@") if $@;
+
+    if ($self->{storage_migration}) {
+	eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $self->{storage_migration_jobs}) };
+	if (my $err = $@) {
+	    $self->log('err', $err);
+	}
+    }
 }
 
 sub unlock_vm {
-- 
2.20.1




More information about the pve-devel mailing list