[pve-devel] [PATCH qemu-server 06/10] memory: use 64 slots && static dimm size with max is defined

DERUMIER, Alexandre Alexandre.DERUMIER at groupe-cyllene.com
Mon Dec 19 13:05:37 CET 2022


> >      my $static_memory = get_static_mem($conf);
> > +    my $confmem = PVE::QemuServer::parse_memory($conf->{memory});
> >  
> > -    if ($hotplug_features->{memory}) {
> > +    if ($hotplug_features->{memory} || defined($confmem->{max})) {
> 
> So setting 'max' auto-attches the dimms[0], but without memory
> hotplug
> enabled, those are useless? Or am I missing something? I feel like we
> can just keep the conditional here and below[0] as-is.
> 

yes, I was not sure here(same for virtio-mem).

virtiomem && maxmem values only usefull make sense if memory hotplug is
enabled, but for example, for cpu hotplug, we can define a specific
vcpu number, without the hotplug cpu option enabled.

So I don't known if we should conditionnaly change hardware topology
depending of an hotplug option.
(I mean, only the hotplug action itself should be blocked/allowed by
the option)



> >         die "NUMA needs to be enabled for memory hotplug\n" if
> > !$conf->{numa};
> >         my $MAX_MEM = get_max_mem($conf);
> >         die "Total memory is bigger than ${MAX_MEM}MB\n" if $memory
> > > $MAX_MEM;
> > @@ -334,7 +342,8 @@ sub config {
> >         }
> >  
> >         die "minimum memory must be ${static_memory}MB\n"
> > if($memory < $static_memory);
> > -       push @$cmd, '-m',
> > "size=${static_memory},slots=255,maxmem=${MAX_MEM}M";
> > +       my $slots = $confmem->{max} ? 64 : 255;
> > +       push @$cmd, '-m',
> > "size=${static_memory},slots=$slots,maxmem=${MAX_MEM}M";
> >  
> >      } else {
> >         push @$cmd, '-m', $static_memory;
> > @@ -403,7 +412,7 @@ sub config {
> >         }
> >      }
> >  
> > -    if ($hotplug_features->{memory}) {
> > +    if ($hotplug_features->{memory} || $confmem->{max}) {
> 
> [0]: here
> 
> >         foreach_dimm($conf, $vmid, $memory, $sockets, sub {
> >             my ($conf, $vmid, $name, $dimm_size, $numanode,
> > $current_size, $memory) = @_;
> >  
> 



More information about the pve-devel mailing list