[pve-devel] applied: [PATCH v3 qemu-server 1/1] migrate cache-size : power of 2
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Feb 22 16:30:29 CET 2018
applied, thanks
On Tue, Feb 13, 2018 at 08:51:15AM +0100, Alexandre Derumier wrote:
> qemu 2.11 need a power of 2 cache size.
>
> "
> Parameter 'xbzrle_cache_size' expects is invalid,
> it should be bigger than target page size and a power of two
> "
>
> roundup to near power of 2 value
> ---
> PVE/QemuMigrate.pm | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 937a855..fcad17c 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -691,6 +691,8 @@ sub phase2 {
> # set cachesize to 10% of the total memory
> my $memory = $conf->{memory} || $defaults->{memory};
> my $cachesize = int($memory * 1048576 / 10);
> + $cachesize = round_powerof2($cachesize);
> +
> $self->log('info', "set cachesize: $cachesize");
> eval {
> PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-cache-size", value => int($cachesize));
> @@ -1031,4 +1033,9 @@ sub final_cleanup {
> # nothing to do
> }
>
> +sub round_powerof2 {
> + return 1 if $_[0] < 2;
> + return 2 << int(log($_[0]-1)/log(2));
> +}
> +
> 1;
> --
> 2.11.0
More information about the pve-devel
mailing list