[pve-devel] [PATCH qemu-server 3/7] bwlimit: add parameter to QemuMigrate::sync_disks

Thomas Lamprecht t.lamprecht at proxmox.com
Sat Mar 30 10:20:12 CET 2019


On 3/29/19 8:28 AM, Stoiko Ivanov wrote:
> used for offline migration of local volumes
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 8f4ee5b..740c673 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -452,8 +452,12 @@ sub sync_disks {
>  		push @{$self->{volumes}}, $volid;
>  		my $insecure = $self->{opts}->{migration_type} eq 'insecure';
>  		my $with_snapshots = $local_volumes->{$volid}->{snapshots};
> +		my $bwlimit = PVE::Storage::get_bandwidth_limit('migrate', [$targetsid, $sid], $self->{opts}->{bwlimit});

we probably should document in the dc.conf schema that migrate also is
placed upon "local disk needing migration" to make this a bit more clear,
not that one expect that for such stuff the "move" limit is used...
Or should that be used, to allow one to distinct storage and memory bwlimits?

nit: we use $self->{opts} again for checking insecure migration above, we maybe
could do a "my $opts = $self->{opts}" at the start of sync_disks and use this one,
but this can be cleaned just fine later on in a separate patch.

> +		#JSONSchema and get_bandwidth_limit use kbps - storage_migrate bps

So I just created a "Comments" subsection in your Perl Style Guide ;-P
https://pve.proxmox.com/wiki/Perl_Style_Guide#Comments

> +		$bwlimit = $bwlimit * 1024 if defined($bwlimit);
> +
>  		PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $targetsid,
> -					      undef, undef, undef, undef, $insecure, $with_snapshots);
> +					      undef, undef, undef, $bwlimit, $insecure, $with_snapshots);
>  	    }
>  	}
>      };
> 





More information about the pve-devel mailing list