[pve-devel] [PATCH 2/3] implement hotplug for cpuunits

Alexandre Derumier aderumier at odiso.com
Thu May 28 12:28:29 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 21fa84c..a8177d7 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3949,6 +3949,8 @@ sub vmconfig_hotplug_pending {
 	    } elsif ($opt =~ m/^memory$/) {
 		die "skip\n" if !$hotplug_features->{memory};
 		qemu_memory_hotplug($vmid, $conf, $defaults, $opt);
+	    } elsif ($opt eq 'cpuunits') {
+		cgroups_write("cpu", $vmid, "cpu.shares", $defaults->{cpuunits});
 	    } else {
 		die "skip\n";
 	    }
@@ -4002,6 +4004,8 @@ sub vmconfig_hotplug_pending {
 	    } elsif ($opt =~ m/^memory$/) { #dimms
 		die "skip\n" if !$hotplug_features->{memory};
 		$value = qemu_memory_hotplug($vmid, $conf, $defaults, $opt, $value);
+	    } elsif ($opt eq 'cpuunits') {
+		cgroups_write("cpu", $vmid, "cpu.shares", $conf->{pending}->{$opt});
 	    } else {
 		die "skip\n";  # skip non-hot-pluggable options
 	    }
-- 
2.1.4




More information about the pve-devel mailing list