storage_migrate: log bandwidth limit

and avoid undefined post-if declaration of @cstream.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2020-07-29 11:44:18 +02:00
committed by Fabian Grünbichler
parent b31e971ceb
commit 93d1812e5a

View File

@ -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)) {