[pve-devel] [PATCH container 2/2] implement cpulimit hotplugging

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Mar 9 10:01:14 CET 2016


---
 src/PVE/LXC/Config.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 04ce9ef..7c451ba 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -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;
-- 
2.1.4





More information about the pve-devel mailing list