From: Thomas Lamprecht Date: Fri, 3 Jun 2016 09:32:01 +0000 (+0200) Subject: migrate: close tunnel after dest. VM stopped on error X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=92437b8de0159c1261a0eb6a635f8c52be09d3b5;p=qemu-server.git migrate: close tunnel after dest. VM stopped on error 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 --- 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);