[pve-devel] [PATCH qemu-server 08/15] phase2_cleanup: add stop_remote_vm
Alexandre Derumier
aderumier at odiso.com
Mon Apr 29 12:01:23 CEST 2019
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuMigrate.pm | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 414686f..920263a 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -575,14 +575,7 @@ sub phase2_cleanup {
}
}
- my $nodename = PVE::INotify::nodename();
-
- my $cmd = [@{$self->{rem_ssh}}, 'qm', 'stop', $vmid, '--skiplock', '--migratedfrom', $nodename];
- eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
- if (my $err = $@) {
- $self->log('err', $err);
- $self->{errors} = 1;
- }
+ stop_remote_vm($self, $vmid);
if ($self->{tunnel}) {
eval { finish_tunnel($self, $self->{tunnel}); };
@@ -1131,4 +1124,17 @@ sub unlock_vm {
}
}
+sub stop_remote_vm {
+ my ($self, $vmid) = @_;
+
+ my $nodename = PVE::INotify::nodename();
+
+ my $cmd = [@{$self->{rem_ssh}}, 'qm', 'stop', $vmid, '--skiplock', '--migratedfrom', $nodename];
+ eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
+ if (my $err = $@) {
+ $self->log('err', $err);
+ $self->{errors} = 1;
+ }
+}
+
1;
--
2.11.0
More information about the pve-devel
mailing list