'-1' means no limit for this cgroup value, so use this like we already do when
deleting the cpulimit.
my $list = PVE::LXC::verify_searchdomain_list($value);
$conf->{$opt} = $list;
} elsif ($opt eq 'cpulimit') {
- PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.cfs_quota_us", int(100000*$value));
+ if ($value == 0) {
+ PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.cfs_quota_us", -1);
+ } else {
+ PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.cfs_quota_us", int(100000*$value));
+ }
$conf->{$opt} = $value;
} elsif ($opt eq 'cpuunits') {
$conf->{$opt} = $value;