[pve-devel] [PATCH qemu-server 2/2] Die on misaligned memory for hotplugging

Alwin Antreich a.antreich at proxmox.com
Thu Mar 19 14:22:59 CET 2020


On Wed, Mar 18, 2020 at 04:18:45PM +0100, Stefan Reiter wrote:
> ...instead of booting with an invalid config once and then silently
> changing the memory size for consequent VM starts.
> 
> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
> ---
Tested-by: Alwin Antreich <a.antreich at proxmox.com>

> 
> This confused me for a bit, I don't think that's very nice behaviour as it
> stands.
> 
>  PVE/QemuServer/Memory.pm | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/QemuServer/Memory.pm b/PVE/QemuServer/Memory.pm
> index ae9598b..b7cf5d5 100644
> --- a/PVE/QemuServer/Memory.pm
> +++ b/PVE/QemuServer/Memory.pm
> @@ -321,11 +321,8 @@ sub config {
>  	    push @$cmd, "-object" , $mem_object;
>  	    push @$cmd, "-device", "pc-dimm,id=$name,memdev=mem-$name,node=$numanode";
>  
> -	    #if dimm_memory is not aligned to dimm map
> -	    if($current_size > $memory) {
> -	         $conf->{memory} = $current_size;
> -	         PVE::QemuConfig->write_config($vmid, $conf);
> -	    }
> +	    die "memory size ($memory) must be aligned to $dimm_size for hotplugging\n"
same nit as in my mail to path 1/2

> +		if $current_size > $memory;
>  	});
>      }
>  }
> -- 
> 2.25.1
> 




More information about the pve-devel mailing list