[pve-devel] [PATCH qemu-server v2 4/8] QemuMigrate::sync_disks: small refactoring
Stoiko Ivanov
s.ivanov at proxmox.com
Mon Apr 1 11:31:01 CEST 2019
factor out accessing $self->{opts}, since it's used twice.
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
PVE/QemuMigrate.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index c4620a5..55c9a7c 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -464,10 +464,11 @@ sub sync_disks {
} else {
next if $rep_volumes->{$volid};
push @{$self->{volumes}}, $volid;
- my $insecure = $self->{opts}->{migration_type} eq 'insecure';
+ my $opts = $self->{opts};
+ my $insecure = $opts->{migration_type} eq 'insecure';
my $with_snapshots = $local_volumes->{$volid}->{snapshots};
# use 'migrate' limit for transfer to other node
- my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$targetsid, $sid], $self->{opts}->{bwlimit});
+ my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$targetsid, $sid], $opts->{bwlimit});
# JSONSchema and get_bandwidth_limit use kbps - storage_migrate bps
$bwlimit = $bwlimit * 1024 if defined($bwlimit);
--
2.11.0
More information about the pve-devel
mailing list