From 93d1812e5a276d6a525966be447c5b09e79e8735 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Wed, 29 Jul 2020 11:44:18 +0200 Subject: [PATCH] storage_migrate: log bandwidth limit and avoid undefined post-if declaration of @cstream. Signed-off-by: Fabian Ebner --- 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)) {