[pve-devel] [PATCH guest-common] replication: replicate_volume: rate can be undefined

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jun 14 10:23:51 CEST 2017


as it is optional in which case we want to pass undef to
stogae_migrate
---
 PVE/Replication.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index bae4c73..ed8d07b 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -111,7 +111,7 @@ sub replicate_volume {
 
     my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid);
 
-    my $ratelimit_bps = int(1000000*$rate);
+    my $ratelimit_bps = int(1000000*$rate) if $rate;
     PVE::Storage::storage_migrate($storecfg, $volid, $ssh_info, $storeid, $volname,
 				  $base_snapshot, $sync_snapname, $ratelimit_bps, $insecure);
 }
-- 
2.11.0





More information about the pve-devel mailing list