pass bwlimit parameter to storage_migrate

Signed-off-by: Stoiko Ivanov <[email protected]>
---
 src/PVE/LXC/Migrate.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index 1364b8d..6e85c61 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -283,7 +283,10 @@ sub phase1 {
        my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
        push @{$self->{volumes}}, $volid;
        my $with_snapshots = $volhash->{$volid}->{snapshots};
-       PVE::Storage::storage_migrate($self->{storecfg}, $volid, 
$self->{ssh_info}, $sid, undef, undef, undef, undef, $insecure, 
$with_snapshots);
+       my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$sid], 
$self->{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 $conffile = PVE::LXC::Config->config_file($vmid);
-- 
2.11.0


_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to