[libvirt PATCH 14/15] qemu: create cgroup regardless of controller support

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Mon Apr 6 21:27:11 UTC 2020


From: Marc-André Lureau <marcandre.lureau at redhat.com>

This allow for basic process management, at least.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/qemu/qemu_process.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6b9f6fb860..0c33eab26c 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2674,6 +2674,9 @@ qemuProcessSetupPid(virDomainObjPtr vm,
         afinity_cpumask = hostcpumap;
     }
 
+    if (priv->cgroup && virCgroupNewThread(priv->cgroup, nameval, id, true, &cgroup) < 0)
+        goto cleanup;
+
     /*
      * If CPU cgroup controller is not initialized here, then we need
      * neither period nor quota settings.  And if CPUSET controller is
@@ -2689,9 +2692,6 @@ qemuProcessSetupPid(virDomainObjPtr vm,
                                                 &mem_mask, -1) < 0)
             goto cleanup;
 
-        if (virCgroupNewThread(priv->cgroup, nameval, id, true, &cgroup) < 0)
-            goto cleanup;
-
         if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
             if (use_cpumask &&
                 qemuSetupCgroupCpusetCpus(cgroup, use_cpumask) < 0)
-- 
2.26.0.rc2.42.g98cedd0233




More information about the libvir-list mailing list