]> git.proxmox.com Git - pve-storage.git/commitdiff
storage_migrate: log bandwidth limit
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 29 Jul 2020 09:44:18 +0000 (11:44 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 4 Aug 2020 11:57:24 +0000 (13:57 +0200)
and avoid undefined post-if declaration of @cstream.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage.pm

index 6951e428d5f3d265e4c93b4ad11afb04f9a8a436..4a60615926145f81077e3e4a8b428c2aebedb9ca 100755 (executable)
@@ -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)) {