---
src/libvirt_private.syms | 10 ++++
src/util/cgroup.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++
src/util/cgroup.h | 11 +++++
3 files changed, 133 insertions(+), 0 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b9d537e..d48b7dc 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -78,6 +78,11 @@ virCgroupGetCpuShares;
virCgroupGetCpuCfsPeriod;
virCgroupGetCpuCfsQuota;
virCgroupGetCpuacctUsage;
+virCgroupGetCpusetHardwall;
+virCgroupGetCpusetMemExclusive;
+virCgroupGetCpusetMemorySpreadPage;
+virCgroupGetCpusetMemorySpreadSlab;
+virCgroupGetCpusetMems;
virCgroupGetFreezerState;
virCgroupGetMemoryHardLimit;
virCgroupGetMemorySoftLimit;
@@ -93,6 +98,11 @@ virCgroupSetBlkioWeight;
virCgroupSetCpuShares;
virCgroupSetCpuCfsPeriod;
virCgroupSetCpuCfsQuota;
+virCgroupSetCpusetHardwall;
+virCgroupSetCpusetMemExclusive;
+virCgroupSetCpusetMemorySpreadPage;
+virCgroupSetCpusetMemorySpreadSlab;
+virCgroupSetCpusetMems;
virCgroupSetFreezerState;
virCgroupSetMemory;
virCgroupSetMemoryHardLimit;
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index c8d1f33..c9cd90b 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -1154,6 +1154,118 @@ int virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long
long *kb)
}
/**
+ * virCgroupSetCpusetMems:
+ *
+ * @group: The cgroup to set cpuset.mems for
+ * @mems: the numa nodes to set
+ *
+ * Returns: 0 on success
+ */
+int virCgroupSetCpusetMems(virCgroupPtr group, const char *mems)
+{
+ return virCgroupSetValueStr(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mems",
+ mems);
+}
+
+/**
+ * virCgroupGetCpusetMems:
+ *
+ * @group: The cgroup to get cpuset.mems for
+ * @mems: the numa nodes to get
+ *
+ * Returns: 0 on success
+ */
+int virCgroupGetCpusetMems(virCgroupPtr group, char **mems)
+{
+ return virCgroupGetValueStr(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mems",
+ mems);
+}
+
+/**
+ * virCgroupSetCpusetHardwall:
+ *
+ * @group: The cgroup to set cpuset.mems for
+ * @hardwall: the hardwall to set
+ *
+ * Returns: 0 on success
+ */
+int virCgroupSetCpusetHardwall(virCgroupPtr group, unsigned long long hardwall)
+{
+ return virCgroupSetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mem_hardwall",
+ hardwall);
+}
+
+/**
+ * virCgroupGetCpusetHardwall:
+ *
+ * @group: The cgroup to get cpuset.mem_hardwall for
+ * @hardwall: the hardwall to get
+ *
+ * Returns: 0 on success
+ */
+int virCgroupGetCpusetHardwall(virCgroupPtr group, unsigned long long *hardwall)
+{
+ return virCgroupGetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mem_hardwall",
+ hardwall);
+}
+
+int virCgroupSetCpusetMemExclusive(virCgroupPtr group, unsigned long long memExclusive)
+{
+ return virCgroupSetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mem_exclusive",
+ memExclusive);
+}
+
+int virCgroupGetCpusetMemExclusive(virCgroupPtr group, unsigned long long *memExclusive)
+{
+ return virCgroupGetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.mem_exclusive",
+ memExclusive);
+}
+
+int virCgroupSetCpusetMemorySpreadPage(virCgroupPtr group, unsigned long long
memSpreadPage)
+{
+ return virCgroupSetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.memory_spread_page",
+ memSpreadPage);
+}
+
+int virCgroupGetCpusetMemorySpreadPage(virCgroupPtr group, unsigned long long
*memSpreadPage)
+{
+ return virCgroupGetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.memory_spread_page",
+ memSpreadPage);
+}
+
+int virCgroupSetCpusetMemorySpreadSlab(virCgroupPtr group, unsigned long long
memSpreadSlab)
+{
+ return virCgroupSetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.memory_spread_slab",
+ memSpreadSlab);
+}
+
+int virCgroupGetCpusetMemorySpreadSlab(virCgroupPtr group, unsigned long long
*memSpreadSlab)
+{
+ return virCgroupGetValueU64(group,
+ VIR_CGROUP_CONTROLLER_CPUSET,
+ "cpuset.memory_spread_slab",
+ memSpreadSlab);
+}
+
+/**
* virCgroupDenyAllDevices:
*
* @group: The cgroup to deny all permissions, for all devices
diff --git a/src/util/cgroup.h b/src/util/cgroup.h
index d190bb3..8825b19 100644
--- a/src/util/cgroup.h
+++ b/src/util/cgroup.h
@@ -115,6 +115,17 @@ int virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long
*usage);
int virCgroupSetFreezerState(virCgroupPtr group, const char *state);
int virCgroupGetFreezerState(virCgroupPtr group, char **state);
+int virCgroupSetCpusetMems(virCgroupPtr group, const char *mems);
+int virCgroupGetCpusetMems(virCgroupPtr group, char **mems);
+int virCgroupSetCpusetMemExclusive(virCgroupPtr group, unsigned long long memExclusive);
+int virCgroupGetCpusetMemExclusive(virCgroupPtr group, unsigned long long
*memExclusive);
+int virCgroupSetCpusetHardwall(virCgroupPtr group, unsigned long long hardwall);
+int virCgroupGetCpusetHardwall(virCgroupPtr group, unsigned long long *hardwall);
+int virCgroupSetCpusetMemorySpreadPage(virCgroupPtr group, unsigned long long
memSpreadPage);
+int virCgroupGetCpusetMemorySpreadPage(virCgroupPtr group, unsigned long long
*memSpreadPage);
+int virCgroupSetCpusetMemorySpreadSlab(virCgroupPtr group, unsigned long long
memSpreadSlab);
+int virCgroupGetCpusetMemorySpreadSlab(virCgroupPtr group, unsigned long long
*memSpreadSlab);
+
int virCgroupRemove(virCgroupPtr group);
void virCgroupFree(virCgroupPtr *group);
--
1.7.3.1