]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/API2/LXC.pm
api: create/update vm: clamp cpu unit value
[pve-container.git] / src / PVE / API2 / LXC.pm
index 589f96f6090d3503390c3c29810770a6831d269a..79aecaa2b2b1910274e4f13b59fa13da397ce413 100644 (file)
@@ -221,6 +221,9 @@ __PACKAGE__->register_method({
        my $restore = extract_param($param, 'restore');
        my $unique = extract_param($param, 'unique');
 
+       $param->{cpuunits} = PVE::CGroup::clamp_cpu_shares($param->{cpuunits})
+           if defined($param->{cpuunits}); # clamp value depending on cgroup version
+
        # used to skip firewall config restore if user lacks permission
        my $skip_fw_config_restore = 0;