]> git.proxmox.com Git - qemu-server.git/commitdiff
close tunnel after migration is finish.
authorWolfgang Link <w.link@proxmox.com>
Tue, 2 Feb 2016 10:53:17 +0000 (11:53 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 2 Feb 2016 17:16:18 +0000 (18:16 +0100)
if we do not close it, there is a change that the tunnel stays open and the next migration will not work.

PVE/QemuMigrate.pm

index 7ae3880adc09e628a9f1deacc1e6dad157f70513..5da62eb53db6682b13ba9f1a95a3f81cc2e55f52 100644 (file)
@@ -520,6 +520,14 @@ sub phase2 {
            die "unable to parse migration status '$stat->{status}' - aborting\n";
        }
     }
+    #to be sure tat the tunnel is closed 
+    if ($self->{tunnel}) {
+       eval { finish_tunnel($self, $self->{tunnel});  };
+       if (my $err = $@) {
+           $self->log('err', $err);
+           $self->{errors} = 1;
+       }
+    }
 }
 
 sub phase2_cleanup {
@@ -552,6 +560,14 @@ sub phase2_cleanup {
         $self->log('err', $err);
         $self->{errors} = 1;
     }
+
+    if ($self->{tunnel}) {
+       eval { finish_tunnel($self, $self->{tunnel});  };
+       if (my $err = $@) {
+           $self->log('err', $err);
+           $self->{errors} = 1;
+       }
+    }
 }
 
 sub phase3 {
@@ -621,14 +637,6 @@ sub phase3_cleanup {
        $self->{errors} = 1;
     }
 
-    if ($self->{tunnel}) {
-       eval { finish_tunnel($self, $self->{tunnel});  };
-       if (my $err = $@) {
-           $self->log('err', $err);
-           $self->{errors} = 1;
-       }
-    }
-
     # always deactivate volumes - avoid lvm LVs to be active on several nodes
     eval {
        my $vollist = PVE::QemuServer::get_vm_volumes($conf);