]> git.proxmox.com Git - qemu-server.git/commitdiff
migrate: close tunnel after dest. VM stopped on error
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 3 Jun 2016 09:32:01 +0000 (11:32 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jun 2016 10:00:25 +0000 (12:00 +0200)
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@proxmox.com>
PVE/QemuMigrate.pm

index 89af111f611d1fa39ef13fc30033d4b0d5b2bfbd..3085864a17bee1ef58a2273f7201708e8e3e1014 100644 (file)
@@ -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);