mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
util: vircgroupv2: enable CPU controller only if it's available
It might happen that we are not able to enable CPU controller so we can enable it for thread sub-cgroups only if it's available in parent cgroup. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
535bdf83c0
commit
f9d1c08557
@ -404,7 +404,8 @@ virCgroupV2MakeGroup(virCgroupPtr parent ATTRIBUTE_UNUSED,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virCgroupV2EnableController(parent,
|
||||
if (virCgroupV2HasController(parent, VIR_CGROUP_CONTROLLER_CPU) &&
|
||||
virCgroupV2EnableController(parent,
|
||||
VIR_CGROUP_CONTROLLER_CPU) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user