]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuMigrate.pm
fix #1569: add shared flag to disks
[qemu-server.git] / PVE / QemuMigrate.pm
index fc847cc06c2771937867067f39b59a45c5d4e5fd..cf1edefbd26d5806ea2962936a2d2af26f041934 100644 (file)
@@ -269,8 +269,6 @@ sub sync_disks {
     # local volumes which have been copied
     $self->{volumes} = [];
 
-    my $res = [];
-
     eval {
 
        # found local volumes and their origin
@@ -320,6 +318,7 @@ sub sync_disks {
            my ($volid, $attr) = @_;
 
            if ($volid =~ m|^/|) {
+               return if $attr->{shared};
                $local_volumes->{$volid}->{ref} = 'config';
                die "local file/device\n";
            }
@@ -601,8 +600,9 @@ sub phase2 {
 
     die "unable to detect remote migration address\n" if !$raddr;
 
+    $self->log('info', "start remote tunnel");
+
     if ($migration_type eq 'secure') {
-       $self->log('info', "start remote tunnel");
 
        if ($ruri =~ /^unix:/) {
            unlink $raddr;
@@ -635,6 +635,9 @@ sub phase2 {
        } else {
            die "unsupported protocol in migration URI: $ruri\n";
        }
+    } else {
+       #fork tunnel for insecure migration, to send faster commands like resume
+       $self->{tunnel} = $self->fork_tunnel();
     }
 
     my $start = time();
@@ -930,11 +933,6 @@ sub phase3_cleanup {
 
     if ($self->{livemigration}) {
        if ($self->{storage_migration}) {
-           # remove drives referencing the nbd server from source
-           # otherwise vm_stop might hang later on
-           foreach my $drive (keys %{$self->{target_drive}}){
-               PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "device_del", id => $drive);
-           }
            # stop nbd server on remote vm - requirement for resume since 2.9
            my $cmd = [@{$self->{rem_ssh}}, 'qm', 'nbdstop', $vmid];