]> git.proxmox.com Git - pve-container.git/commitdiff
implement cpulimit hotplugging
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 9 Mar 2016 09:01:14 +0000 (10:01 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 9 Mar 2016 16:51:53 +0000 (17:51 +0100)
src/PVE/LXC/Config.pm

index 04ce9ef452f862f74434ff2f911b38070047692d..7c451ba851dcfffa02ed736f05a47fc278e5e6be 100644 (file)
@@ -733,7 +733,7 @@ sub update_pct_config {
                next if $hotplug_error->($opt);
                delete $conf->{$opt};
            } elsif ($opt eq 'cpulimit') {
-               next if $hotplug_error->($opt); # FIXME: hotplug
+               PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.cfs_quota_us", -1);
                delete $conf->{$opt};
            } elsif ($opt eq 'cpuunits') {
                PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.shares", $confdesc->{cpuunits}->{default});
@@ -827,7 +827,7 @@ sub update_pct_config {
            my $list = PVE::LXC::verify_searchdomain_list($value);
            $conf->{$opt} = $list;
        } elsif ($opt eq 'cpulimit') {
-           next if $hotplug_error->($opt); # FIXME: hotplug
+           PVE::LXC::write_cgroup_value("cpu", $vmid, "cpu.cfs_quota_us", int(100000*$value));
            $conf->{$opt} = $value;
        } elsif ($opt eq 'cpuunits') {
            $conf->{$opt} = $value;