]> git.proxmox.com Git - pve-container.git/commitdiff
correctly set unlimited cpulimit at runtime
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 15 Sep 2016 12:51:57 +0000 (14:51 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Sep 2016 05:42:23 +0000 (07:42 +0200)
'-1' means no limit for this cgroup value, so use this like we already do when
deleting the cpulimit.

src/PVE/LXC/Config.pm

index 7480fffb7f7f4a936221e1755acff13de326c248..2ec643e4230db6d076354b6b7ba4b43b51e6f167 100644 (file)
@@ -883,7 +883,11 @@ sub update_pct_config {
            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;