[PATCH v1 rebase 1/6] cgroup: Add a flag VIR_CGROUP_DISABLE_CPUSET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a flag VIR_CGROUP_DISABLE_CPUSET to disable cgroup cpuset.
This flag inhibits making of directory under cpuset.
---
 src/util/cgroup.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index f867fb7..e955a22 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -72,6 +72,7 @@ typedef enum {
                                        */
     VIR_CGROUP_VCPU = 1 << 1, /* create subdir only under the cgroup cpu,
                                * cpuacct and cpuset if possible. */
+    VIR_CGROUP_DISABLE_CPUSET = 1 << 2,
 } virCgroupFlags;
 
 /**
@@ -542,6 +543,12 @@ static int virCgroupMakeGroup(virCgroupPtr parent,
         if (!group->controllers[i].mountPoint)
             continue;
 
+        if ((flags & VIR_CGROUP_DISABLE_CPUSET) &&
+            i == VIR_CGROUP_CONTROLLER_CPUSET) {
+            group->controllers[i].mountPoint = NULL;
+            continue;
+        }
+
         /* We need to control cpu bandwidth for each vcpu now */
         if ((flags & VIR_CGROUP_VCPU) &&
             (i != VIR_CGROUP_CONTROLLER_CPU &&
-- 
1.8.0.1.240.ge8a1f5a

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]