mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-11-05 01:32:37 +00:00
systemd scope: add CPUWeight for cgroupv2
This commit is contained in:
parent
5b65b00d04
commit
6cbd3eb82c
@ -5078,10 +5078,15 @@ sub vm_start_nolock {
|
|||||||
|
|
||||||
my %properties = (
|
my %properties = (
|
||||||
Slice => 'qemu.slice',
|
Slice => 'qemu.slice',
|
||||||
KillMode => 'none',
|
KillMode => 'none'
|
||||||
CPUShares => $cpuunits
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (PVE::CGroup::cgroup_mode() == 2) {
|
||||||
|
$properties{CPUWeight} = $cpuunits;
|
||||||
|
} else {
|
||||||
|
$properties{CPUShares} = $cpuunits;
|
||||||
|
}
|
||||||
|
|
||||||
if (my $cpulimit = $conf->{cpulimit}) {
|
if (my $cpulimit = $conf->{cpulimit}) {
|
||||||
$properties{CPUQuota} = int($cpulimit * 100);
|
$properties{CPUQuota} = int($cpulimit * 100);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user