[pve-devel] [PATCH v5 3/4] migrate: close tunnel after dest. VM stopped on error
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Jun 3 11:32:01 CEST 2016
On error let phase2_cleanup close the tunnel as it stops the for
incoming migration waiting VM on the destination first, to be safe.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
changes since v4:
* this is new and was splitted away from the previous patch as it has another
intend.
PVE/QemuMigrate.pm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 89af111..3085864 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -609,8 +609,10 @@ sub phase2 {
die "unable to parse migration status '$stat->{status}' - aborting\n";
}
}
- #to be sure tat the tunnel is closed
- if ($self->{tunnel}) {
+
+ # just to be sure that the tunnel gets closed on successful migration, on error
+ # phase2_cleanup closes it *after* stopping the remote waiting VM
+ if (!$self->{errors} && $self->{tunnel}) {
eval { finish_tunnel($self, $self->{tunnel}); };
if (my $err = $@) {
$self->log('err', $err);
--
2.1.4
More information about the pve-devel
mailing list