---
 PVE/QemuServer.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1fd6338..af74d64 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5064,10 +5064,15 @@ sub vm_start_nolock {
 
     my %properties = (
        Slice => 'qemu.slice',
-       KillMode => 'none',
-       CPUShares => $cpuunits
+       KillMode => 'none'
     );
 
+    if (PVE::CGroup::cgroup_mode() == 2) {
+       $properties{CPUWeight} = $cpuunits;
+    } else {
+       $properties{CPUShares} = $cpuunits;
+    }
+
     if (my $cpulimit = $conf->{cpulimit}) {
        $properties{CPUQuota} = int($cpulimit * 100);
     }
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to