[PATCH 8/9] qemu_cgroup: dont put qemu main thread into wrong cgroup

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

 



Eventually all qemu threads are supposed to be in the final cgroup
structure in one of the leaf cgroups (vcpuX, emulator). They should
never be in the main machine cgroup. That is for all thread related
controllers like cpuset, cpu, and cpuacct.
By excluding the threading related controllers we do not put the
task into the machine cgroup controllers just to move it out to
the emulator subgroup later.

Signed-off-by: Henning Schild <henning.schild@xxxxxxxxxxx>
---
 src/qemu/qemu_cgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 41a583c..99fb5bf 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -789,7 +789,8 @@ qemuInitCgroup(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    if (virCgroupAddTask(priv->cgroup, vm->pid, -1) < 0) {
+    if (virCgroupAddTask(priv->cgroup, vm->pid,
+                         ~VIR_CGROUP_THREAD_CONTROLLER_MASK) < 0) {
         virErrorPtr saved = virSaveLastError();
         virCgroupRemove(priv->cgroup);
         virCgroupFree(&priv->cgroup);
-- 
2.4.10

--
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]