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