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

Fiona Ebner f.ebner at proxmox.com
Mon Jan 30 09:04:13 CET 2023


Am 27.01.23 um 16:15 schrieb DERUMIER, Alexandre:
> 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).

You're right, I missed that.

> 
> 
> 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