render / rpms / libvirt

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