Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/libvirt_private.syms | 1 -
src/util/vircgroup.c | 69 +++++++++++++++++-----------------------
src/util/vircgroup.h | 4 ---
3 files changed, 29 insertions(+), 45 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8f80ee2250..95d7c9f834 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1496,7 +1496,6 @@ virBufferVasprintf;
# util/vircgroup.h
virCgroupAddMachineTask;
virCgroupAddTask;
-virCgroupAddTaskController;
virCgroupAllowAllDevices;
virCgroupAllowDevice;
virCgroupAllowDevicePath;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index d9f6c5b06f..6d937626e6 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1136,6 +1136,35 @@ 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)
{
@@ -1197,35 +1226,6 @@ virCgroupAddMachineTask(virCgroupPtr group, 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
- */
-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
virCgroupSetPartitionSuffix(const char *path, char **res)
{
@@ -4115,17 +4115,6 @@ virCgroupAddMachineTask(virCgroupPtr group ATTRIBUTE_UNUSED,
}
-int
-virCgroupAddTaskController(virCgroupPtr group ATTRIBUTE_UNUSED,
- pid_t pid ATTRIBUTE_UNUSED,
- int controller ATTRIBUTE_UNUSED)
-{
- virReportSystemError(ENXIO, "%s",
- _("Control groups not supported on this platform"));
- return -1;
-}
-
-
int
virCgroupGetBlkioIoServiced(virCgroupPtr group ATTRIBUTE_UNUSED,
long long *bytes_read ATTRIBUTE_UNUSED,
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index a23a491d95..74c7dbcccc 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -134,10 +134,6 @@ int virCgroupPathOfController(virCgroupPtr group,
int virCgroupAddTask(virCgroupPtr group, pid_t pid);
int virCgroupAddMachineTask(virCgroupPtr group, pid_t pid);
-int virCgroupAddTaskController(virCgroupPtr group,
- pid_t pid,
- int controller);
-
int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight);
int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight);
--
2.17.1