[pve-devel] [PATCH v2 qemu-server 5/9] memory: get_max_mem: use config memory max

DERUMIER, Alexandre Alexandre.DERUMIER at groupe-cyllene.com
Fri Jan 27 16:15:33 CET 2023


Le mardi 24 janvier 2023 à 14:05 +0100, Fiona Ebner a écrit :
> > +my $check_memory_param = sub {
> > +    my ($conf, $param) = @_;
> > +
> > +    my $mem = parse_memory($param->{memory});
> > +    my $host_max_mem = get_host_max_mem($conf);
> > +
> > +    if ($mem->{max}) {
> > +       die "memory max can't be bigger than supported cpu
> > architecture $host_max_mem MB\n"
> 
> s/MB/MiB
> 
> > +           if $mem->{max} > $host_max_mem;
> 
> Style nit: you could && both conditions to save lines
> 
> This could be part of the verifier sub suggested in the last patch

I'm not sure we can use the verifier here,

as we need to retrieve $host_max_mem from the current configuration
with get_host_max_mem($conf).


This current $check_memory_param, in API2::Qemu , it's done in
$updatefn, after the lock on the config.





More information about the pve-devel mailing list