提交 f9d1c085 编写于 作者: P Pavel Hrdina

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: NPavel Hrdina <phrdina@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 535bdf83
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册