]> git.proxmox.com Git - pve-container.git/commit
api: create/update vm: clamp cpu unit value
authorFiona Ebner <f.ebner@proxmox.com>
Fri, 7 Oct 2022 12:41:47 +0000 (14:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Nov 2022 15:10:54 +0000 (16:10 +0100)
commit8fe13f0c6cfa785e3d287ccd60bf2b42b178e68b
tree9895a0e76608e848491e1d2795f1aa33e5e49ec6
parentc439efabf56b3b146550a8944201982b858d1f2b
api: create/update vm: clamp cpu unit value

While the clamping already happens before setting the actual
cpu.weight lxc config key, it can be done here too, to avoid writing
new out-of-range values into the config.

Can't use a validator enforcing this, because existing out-of-range
values should not become errors on parsing the config.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm
src/PVE/API2/LXC/Config.pm