[pve-devel] [PATCH v3 container 12/22] Use new storage_migrate interface

Fabian Ebner f.ebner at proxmox.com
Thu Mar 12 13:08:22 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 6c1e9c1..aafaeeb 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('migration', [$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