]> git.proxmox.com Git - pve-guest-common.git/commitdiff
migrate: set migration_type
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 6 Jun 2017 08:04:00 +0000 (10:04 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Jun 2017 10:24:57 +0000 (12:24 +0200)
Moved from qemu-server: set $opts->{migration_type} to a
default or a value from datacenter.cfg.

PVE/AbstractMigrate.pm

index 3cbe164c544e214de4c2258714c118ebe8e20425..a0096fa7fdbdb77b157fb475b5c07031bffccf09 100644 (file)
@@ -114,14 +114,23 @@ sub migrate {
 
     $class = ref($class) || $class;
 
+    my $dc_conf = PVE::Cluster::cfs_read_file('datacenter.cfg');
+
     my $migration_network = $opts->{migration_network};
     if (!defined($migration_network)) {
-       my $dc_conf = PVE::Cluster::cfs_read_file('datacenter.cfg');
        $migration_network = $dc_conf->{migration}->{network};
     }
     my $ssh_info = PVE::Cluster::get_ssh_info($node, $migration_network);
     $nodeip = $ssh_info->{ip};
 
+    my $migration_type = 'secure';
+    if (defined($opts->{migration_type})) {
+       $migration_type = $opts->{migration_type};
+    } elsif (defined($dc_conf->{migration}->{type})) {
+        $migration_type = $dc_conf->{migration}->{type};
+    }
+    $opts->{migration_type} = $migration_type;
+
     my $self = {
        delayed_interrupt => 0,
        opts => $opts,