|
|
c480ed |
From 88322908f3dfad6217b1c2a2a0f8968b079d0795 Mon Sep 17 00:00:00 2001
|
|
|
c480ed |
Message-Id: <88322908f3dfad6217b1c2a2a0f8968b079d0795@dist-git>
|
|
|
c480ed |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
Date: Mon, 1 Jul 2019 17:06:00 +0200
|
|
|
c480ed |
Subject: [PATCH] vircgroup: Remove virCgroupAddTaskController
|
|
|
c480ed |
MIME-Version: 1.0
|
|
|
c480ed |
Content-Type: text/plain; charset=UTF-8
|
|
|
c480ed |
Content-Transfer-Encoding: 8bit
|
|
|
c480ed |
|
|
|
c480ed |
There is no need for this function, both of the checks are done
|
|
|
c480ed |
later by virCgroupGetControllerPath.
|
|
|
c480ed |
|
|
|
c480ed |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
(cherry picked from commit db868852fdb32c76955c925dcbd92b2d6d9bfeb2)
|
|
|
c480ed |
|
|
|
c480ed |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
|
|
|
c480ed |
|
|
|
c480ed |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
Message-Id: <b6c7c27ed52a39343d7d0f14feab71726ff0c279.1561993099.git.phrdina@redhat.com>
|
|
|
c480ed |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
c480ed |
---
|
|
|
c480ed |
src/util/vircgroup.c | 31 +------------------------------
|
|
|
c480ed |
1 file changed, 1 insertion(+), 30 deletions(-)
|
|
|
c480ed |
|
|
|
c480ed |
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
|
|
|
c480ed |
index 5adf9d3c11..a94f958d75 100644
|
|
|
c480ed |
--- a/src/util/vircgroup.c
|
|
|
c480ed |
+++ b/src/util/vircgroup.c
|
|
|
c480ed |
@@ -1128,35 +1128,6 @@ virCgroupNew(pid_t pid,
|
|
|
c480ed |
}
|
|
|
c480ed |
|
|
|
c480ed |
|
|
|
c480ed |
-/**
|
|
|
c480ed |
- * virCgroupAddTaskController:
|
|
|
c480ed |
- *
|
|
|
c480ed |
- * @group: The cgroup to add a task to
|
|
|
c480ed |
- * @pid: The pid of the task to add
|
|
|
c480ed |
- * @controller: The cgroup controller to be operated on
|
|
|
c480ed |
- *
|
|
|
c480ed |
- * Returns: 0 on success or -1 on error
|
|
|
c480ed |
- */
|
|
|
c480ed |
-static int
|
|
|
c480ed |
-virCgroupAddTaskController(virCgroupPtr group, pid_t pid, int controller)
|
|
|
c480ed |
-{
|
|
|
c480ed |
- if (controller < 0 || controller >= VIR_CGROUP_CONTROLLER_LAST) {
|
|
|
c480ed |
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
|
c480ed |
- _("Controller %d out of range"), controller);
|
|
|
c480ed |
- return -1;
|
|
|
c480ed |
- }
|
|
|
c480ed |
-
|
|
|
c480ed |
- if (!group->controllers[controller].mountPoint) {
|
|
|
c480ed |
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
|
c480ed |
- _("Controller '%s' not mounted"),
|
|
|
c480ed |
- virCgroupControllerTypeToString(controller));
|
|
|
c480ed |
- return -1;
|
|
|
c480ed |
- }
|
|
|
c480ed |
-
|
|
|
c480ed |
- return virCgroupSetValueI64(group, controller, "tasks", pid);
|
|
|
c480ed |
-}
|
|
|
c480ed |
-
|
|
|
c480ed |
-
|
|
|
c480ed |
static int
|
|
|
c480ed |
virCgroupAddTaskInternal(virCgroupPtr group, pid_t pid, bool withSystemd)
|
|
|
c480ed |
{
|
|
|
c480ed |
@@ -1174,7 +1145,7 @@ virCgroupAddTaskInternal(virCgroupPtr group, pid_t pid, bool withSystemd)
|
|
|
c480ed |
if (i == VIR_CGROUP_CONTROLLER_SYSTEMD && !withSystemd)
|
|
|
c480ed |
continue;
|
|
|
c480ed |
|
|
|
c480ed |
- if (virCgroupAddTaskController(group, pid, i) < 0)
|
|
|
c480ed |
+ if (virCgroupSetValueI64(group, i, "tasks", pid) < 0)
|
|
|
c480ed |
goto cleanup;
|
|
|
c480ed |
}
|
|
|
c480ed |
|
|
|
c480ed |
--
|
|
|
c480ed |
2.22.0
|
|
|
c480ed |
|