提交 38411bb8 编写于 作者: P Pavel Hrdina

vircgroup: introduce virCgroupV2HasEmptyTasks

Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 48572f88
......@@ -445,6 +445,22 @@ virCgroupV2AddTask(virCgroupPtr group,
}
static int
virCgroupV2HasEmptyTasks(virCgroupPtr cgroup,
int controller)
{
int ret = -1;
VIR_AUTOFREE(char *) content = NULL;
ret = virCgroupGetValueStr(cgroup, controller, "cgroup.procs", &content);
if (ret == 0 && content[0] == '\0')
ret = 1;
return ret;
}
virCgroupBackend virCgroupV2Backend = {
.type = VIR_CGROUP_BACKEND_TYPE_V2,
......@@ -463,6 +479,7 @@ virCgroupBackend virCgroupV2Backend = {
.makeGroup = virCgroupV2MakeGroup,
.remove = virCgroupV2Remove,
.addTask = virCgroupV2AddTask,
.hasEmptyTasks = virCgroupV2HasEmptyTasks,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册