[pve-devel] [PATCH storage 4/4] storage_migrate: log bandwidth limit

Fabian Ebner f.ebner at proxmox.com
Wed Jul 29 11:44:18 CEST 2020


and avoid undefined post-if declaration of @cstream.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 6951e42..4a60615 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -637,8 +637,11 @@ sub storage_migrate {
     my $ssh_base = PVE::SSHInfo::ssh_info_to_command_base($target_sshinfo);
     local $ENV{RSYNC_RSH} = PVE::Tools::cmd2string($ssh_base);
 
-    my @cstream = ([ '/usr/bin/cstream', '-t', $ratelimit_bps ])
-	if defined($ratelimit_bps);
+    my @cstream;
+    if (defined($ratelimit_bps)) {
+	@cstream = ([ '/usr/bin/cstream', '-t', $ratelimit_bps ]);
+	$logfunc->("using a bandwidth limit of $ratelimit_bps bps for transferring '$volid'") if $logfunc;
+    }
 
     my $migration_snapshot;
     if (!defined($snapshot)) {
-- 
2.20.1






More information about the pve-devel mailing list