From e65e35ca6df4100801a04a45c8aba6c0aee5fbe4 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 11 Feb 2022 09:29:50 +0100 Subject: [PATCH] cpu units: lower minimum for accessing full cgroupv2 range also clamp that up in the v1 case for compat. Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6b04e20..5ccc701 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -336,7 +336,7 @@ my $confdesc = { verbose_description => "CPU weight for a VM. Argument is used in the kernel fair scheduler." ." The larger the number is, the more CPU time this VM gets. Number is relative to" ." weights of all the other running VMs.", - minimum => 2, + minimum => 1, maximum => 262144, default => 'cgroup v1: 1024, cgroup v2: 100', }, @@ -3400,6 +3400,8 @@ my sub get_cpuunits { if ($is_cgroupv2) { $cpuunits = 10000 if $cpuunits >= 10000; # v1 can be higher, so clamp v2 there + } else { + $cpuunits = 2 if $cpuunits < 2; # v2 can be lower, so clamp v1 there } return $cpuunits; } -- 2.39.2