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

vircgroup: Remove virCgroupAddTaskController

There is no need for this function, both of the checks are done
later by virCgroupGetControllerPath.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 f9d18f89
......@@ -1128,35 +1128,6 @@ virCgroupNew(pid_t pid,
}
/**
* virCgroupAddTaskController:
*
* @group: The cgroup to add a task to
* @pid: The pid of the task to add
* @controller: The cgroup controller to be operated on
*
* Returns: 0 on success or -1 on error
*/
static int
virCgroupAddTaskController(virCgroupPtr group, pid_t pid, int controller)
{
if (controller < 0 || controller >= VIR_CGROUP_CONTROLLER_LAST) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Controller %d out of range"), controller);
return -1;
}
if (!group->controllers[controller].mountPoint) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Controller '%s' not mounted"),
virCgroupControllerTypeToString(controller));
return -1;
}
return virCgroupSetValueI64(group, controller, "tasks", pid);
}
static int
virCgroupAddTaskInternal(virCgroupPtr group, pid_t pid, bool withSystemd)
{
......@@ -1174,7 +1145,7 @@ virCgroupAddTaskInternal(virCgroupPtr group, pid_t pid, bool withSystemd)
if (i == VIR_CGROUP_CONTROLLER_SYSTEMD && !withSystemd)
continue;
if (virCgroupAddTaskController(group, pid, i) < 0)
if (virCgroupSetValueI64(group, i, "tasks", pid) < 0)
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册