systemd scope: add CPUWeight for cgroupv2

This commit is contained in:
Alexandre Derumier 2020-10-30 10:42:36 +01:00 committed by Wolfgang Bumiller
parent 5b65b00d04
commit 6cbd3eb82c

View File

@ -5078,10 +5078,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);
}