[pve-devel] [PATCH v4 qemu-server 08/16] config: memory: add 'max' option

DERUMIER, Alexandre Alexandre.DERUMIER at groupe-cyllene.com
Thu Feb 23 08:35:52 CET 2023


Hi,

> > +PVE::JSONSchema::register_format('pve-qm-memory-max',
> > \&verify_qm_memory_max);
> > +sub verify_qm_memory_max {
> > +    my ($max, $noerr) = @_;
> > +
> > +    return if $noerr;
> 
> $noerr only switches if the function should die upon error or return
> undef upon error. But if there is no error, you always need to return
> the verified value, i.e. $max.
> 

I'm a bit lost here. I have looked at other verify subs, and I don't 
have find a single one returning a value on noerr.

All other verify subs have something like:

    if ($max % 65536 != 0) {
        return if $noerr;
        die "max memory need to be a multiple of 64GiB\n";
    }

Could you provide me a code sample of what you want exactly here ?




More information about the pve-devel mailing list