5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-21 18:03:56 +03:00

migrate: finish tunnel in phase 3

after resuming the VM over the tunnel.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2017-08-04 14:54:05 +02:00 committed by Wolfgang Bumiller
parent 1d5aaa1db5
commit 2e7fee87df

View File

@ -818,16 +818,6 @@ sub phase2 {
die "unable to parse migration status '$stat->{status}' - aborting\n";
}
}
# 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);
$self->{errors} = 1;
}
}
}
sub phase2_cleanup {
@ -977,6 +967,15 @@ sub phase3_cleanup {
}
}
# close tunnel on successful migration, on error phase2_cleanup closed it
if ($tunnel) {
eval { finish_tunnel($self, $tunnel); };
if (my $err = $@) {
$self->log('err', $err);
$self->{errors} = 1;
}
}
eval {
my $timer = 0;
if (PVE::QemuServer::vga_conf_has_spice($conf->{vga}) && $self->{running}) {