|
|
c313de |
From df01b3c361e5bdcd8505798336b15b862e9c6bea Mon Sep 17 00:00:00 2001
|
|
|
c313de |
Message-Id: <df01b3c361e5bdcd8505798336b15b862e9c6bea@dist-git>
|
|
|
c313de |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c313de |
Date: Mon, 1 Jul 2019 17:08:11 +0200
|
|
|
c313de |
Subject: [PATCH] util: implement virCgroupV2(Set|Get)CpusetMems
|
|
|
c313de |
MIME-Version: 1.0
|
|
|
c313de |
Content-Type: text/plain; charset=UTF-8
|
|
|
c313de |
Content-Transfer-Encoding: 8bit
|
|
|
c313de |
|
|
|
c313de |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c313de |
(cherry picked from commit 74e7da060543a87610b42fc6ba26a45b0a6e3974)
|
|
|
c313de |
|
|
|
c313de |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
|
|
|
c313de |
|
|
|
c313de |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c313de |
Message-Id: <2bb5ec423c37893ebbf2f882da13cc4e55b23941.1561993100.git.phrdina@redhat.com>
|
|
|
c313de |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
c313de |
---
|
|
|
c313de |
src/util/vircgroupv2.c | 25 +++++++++++++++++++++++++
|
|
|
c313de |
1 file changed, 25 insertions(+)
|
|
|
c313de |
|
|
|
c313de |
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
|
|
|
c313de |
index 8658454d8b..59b8c4ad2c 100644
|
|
|
c313de |
--- a/src/util/vircgroupv2.c
|
|
|
c313de |
+++ b/src/util/vircgroupv2.c
|
|
|
c313de |
@@ -1562,6 +1562,28 @@ virCgroupV2GetCpuacctStat(virCgroupPtr group,
|
|
|
c313de |
}
|
|
|
c313de |
|
|
|
c313de |
|
|
|
c313de |
+static int
|
|
|
c313de |
+virCgroupV2SetCpusetMems(virCgroupPtr group,
|
|
|
c313de |
+ const char *mems)
|
|
|
c313de |
+{
|
|
|
c313de |
+ return virCgroupSetValueStr(group,
|
|
|
c313de |
+ VIR_CGROUP_CONTROLLER_CPUSET,
|
|
|
c313de |
+ "cpuset.mems",
|
|
|
c313de |
+ mems);
|
|
|
c313de |
+}
|
|
|
c313de |
+
|
|
|
c313de |
+
|
|
|
c313de |
+static int
|
|
|
c313de |
+virCgroupV2GetCpusetMems(virCgroupPtr group,
|
|
|
c313de |
+ char **mems)
|
|
|
c313de |
+{
|
|
|
c313de |
+ return virCgroupGetValueStr(group,
|
|
|
c313de |
+ VIR_CGROUP_CONTROLLER_CPUSET,
|
|
|
c313de |
+ "cpuset.mems",
|
|
|
c313de |
+ mems);
|
|
|
c313de |
+}
|
|
|
c313de |
+
|
|
|
c313de |
+
|
|
|
c313de |
virCgroupBackend virCgroupV2Backend = {
|
|
|
c313de |
.type = VIR_CGROUP_BACKEND_TYPE_V2,
|
|
|
c313de |
|
|
|
c313de |
@@ -1621,6 +1643,9 @@ virCgroupBackend virCgroupV2Backend = {
|
|
|
c313de |
|
|
|
c313de |
.getCpuacctUsage = virCgroupV2GetCpuacctUsage,
|
|
|
c313de |
.getCpuacctStat = virCgroupV2GetCpuacctStat,
|
|
|
c313de |
+
|
|
|
c313de |
+ .setCpusetMems = virCgroupV2SetCpusetMems,
|
|
|
c313de |
+ .getCpusetMems = virCgroupV2GetCpusetMems,
|
|
|
c313de |
};
|
|
|
c313de |
|
|
|
c313de |
|
|
|
c313de |
--
|
|
|
c313de |
2.22.0
|
|
|
c313de |
|