Am 23.02.23 um 08:35 schrieb DERUMIER, Alexandre: > 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.
If there is no error and $noerr is set, they do. > > 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"; > } > Yes, this would be correct. Note that it behaves differently from the current patch. The current patch always executes return if $noerr; but the new version only executes it when $max % 65536 != 0. If $max % 65536 == 0, you don't enter the if and then return $max even if $noerr is set. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel