[pve-devel] [PATCH v2 qemu-server 06/16] phase2_cleanup : add cancel_migrate
Alexandre Derumier
aderumier at odiso.com
Mon Mar 9 16:24:29 CET 2020
Also move block job cancel here, before release the lock.
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuMigrate.pm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 1768afc..ff942bb 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -570,11 +570,7 @@ sub phase2_cleanup {
$self->log('info', "aborting phase 2 - cleanup resources");
- $self->log('info', "migrate_cancel");
- eval {
- mon_cmd($vmid, "migrate_cancel");
- };
- $self->log('info', "migrate_cancel error: $@") if $@;
+ cancel_migrate($self, $vmid);
my $conf = $self->{vmconf};
delete $conf->{lock};
@@ -1136,4 +1132,14 @@ sub livemigrate {
}
}
+sub cancel_migrate {
+ my ($self, $vmid) = @_;
+
+ $self->log('info', "migrate_cancel");
+ eval {
+ mon_cmd($vmid, "migrate_cancel");
+ };
+ $self->log('info', "migrate_cancel error: $@") if $@;
+}
+
1;
--
2.20.1
More information about the pve-devel
mailing list