[pve-devel] [PATCH v2 container 21/28] Use new storage_migrate interface

Fabian Ebner f.ebner at proxmox.com
Mon Feb 24 13:44:11 CET 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index 7df3c4c..2efdf84 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -278,17 +278,21 @@ sub phase1 {
     }
 
     my $opts = $self->{opts};
-    my $insecure = $opts->{migration_type} eq 'insecure';
     foreach my $volid (keys %$volhash) {
 	next if $rep_volumes->{$volid};
 	my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
 	push @{$self->{volumes}}, $volid;
-	my $with_snapshots = $volhash->{$volid}->{snapshots};
 	my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$sid], $opts->{bwlimit});
 	# JSONSchema and get_bandwidth_limit use kbps - storage_migrate bps
 	$bwlimit = $bwlimit * 1024 if defined($bwlimit);
 
-	PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, undef, undef, undef, $bwlimit, $insecure, $with_snapshots);
+	my $storage_migrate_opts = {
+	    'bwlimit' => $bwlimit,
+	    'insecure' => $opts->{migration_type} eq 'insecure',
+	    'with_snapshots' => $volhash->{$volid}->{snapshots},
+	};
+
+	PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, $storage_migrate_opts);
     }
 
     my $conffile = PVE::LXC::Config->config_file($vmid);
-- 
2.20.1





More information about the pve-devel mailing list