Blame SOURCES/libvirt-vircgroup-Unexport-unused-function-virCgroupAddTaskController.patch

c480ed
From 7dd9c146f4713fd15b6d6642b910af29846d96e2 Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <7dd9c146f4713fd15b6d6642b910af29846d96e2@dist-git>
c480ed
From: Pavel Hrdina <phrdina@redhat.com>
c480ed
Date: Mon, 1 Jul 2019 17:05:52 +0200
c480ed
Subject: [PATCH] vircgroup: Unexport unused function
c480ed
 virCgroupAddTaskController()
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
(cherry picked from commit 0aaac42a6eb3fb8b5aa412d5153e0d6ae459c631)
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: <30f7f52a9e7d0b9ce838a2d32cc6ec0a0cf97788.1561993099.git.phrdina@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/libvirt_private.syms |  1 -
c480ed
 src/util/vircgroup.c     | 69 +++++++++++++++++-----------------------
c480ed
 src/util/vircgroup.h     |  4 ---
c480ed
 3 files changed, 29 insertions(+), 45 deletions(-)
c480ed
c480ed
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c480ed
index 3117c8009a..41fca88d09 100644
c480ed
--- a/src/libvirt_private.syms
c480ed
+++ b/src/libvirt_private.syms
c480ed
@@ -1515,7 +1515,6 @@ virBufferVasprintf;
c480ed
 # util/vircgroup.h
c480ed
 virCgroupAddMachineTask;
c480ed
 virCgroupAddTask;
c480ed
-virCgroupAddTaskController;
c480ed
 virCgroupAllowAllDevices;
c480ed
 virCgroupAllowDevice;
c480ed
 virCgroupAllowDevicePath;
c480ed
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
c480ed
index 5f949edec8..8ef6fb5e1a 100644
c480ed
--- a/src/util/vircgroup.c
c480ed
+++ b/src/util/vircgroup.c
c480ed
@@ -1136,6 +1136,35 @@ 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
@@ -1197,35 +1226,6 @@ virCgroupAddMachineTask(virCgroupPtr group, 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
-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
 virCgroupSetPartitionSuffix(const char *path, char **res)
c480ed
 {
c480ed
@@ -4115,17 +4115,6 @@ virCgroupAddMachineTask(virCgroupPtr group ATTRIBUTE_UNUSED,
c480ed
 }
c480ed
 
c480ed
 
c480ed
-int
c480ed
-virCgroupAddTaskController(virCgroupPtr group ATTRIBUTE_UNUSED,
c480ed
-                           pid_t pid ATTRIBUTE_UNUSED,
c480ed
-                           int controller ATTRIBUTE_UNUSED)
c480ed
-{
c480ed
-    virReportSystemError(ENXIO, "%s",
c480ed
-                         _("Control groups not supported on this platform"));
c480ed
-    return -1;
c480ed
-}
c480ed
-
c480ed
-
c480ed
 int
c480ed
 virCgroupGetBlkioIoServiced(virCgroupPtr group ATTRIBUTE_UNUSED,
c480ed
                             long long *bytes_read ATTRIBUTE_UNUSED,
c480ed
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
c480ed
index a23a491d95..74c7dbcccc 100644
c480ed
--- a/src/util/vircgroup.h
c480ed
+++ b/src/util/vircgroup.h
c480ed
@@ -134,10 +134,6 @@ int virCgroupPathOfController(virCgroupPtr group,
c480ed
 int virCgroupAddTask(virCgroupPtr group, pid_t pid);
c480ed
 int virCgroupAddMachineTask(virCgroupPtr group, pid_t pid);
c480ed
 
c480ed
-int virCgroupAddTaskController(virCgroupPtr group,
c480ed
-                               pid_t pid,
c480ed
-                               int controller);
c480ed
-
c480ed
 int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight);
c480ed
 int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight);
c480ed
 
c480ed
-- 
c480ed
2.22.0
c480ed