[libvirt PATCH 18/25] vircgroup: no need to use PID in virCgroupEnableMissingControllers

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

 



This function is relevant only with cgroups v1 where it creates
hierarchy for controllers that are not managed by systemd. PID is used
to detect a placement of current process but in this situation we are
building the hierarchy for already known placement.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/util/vircgroup.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 81aa3ee791..2c1d6f9f01 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1112,14 +1112,13 @@ virCgroupNewDetectMachine(const char *name,
 
 static int
 virCgroupEnableMissingControllers(char *path,
-                                  pid_t pidleader,
                                   int controllers,
                                   virCgroupPtr *group)
 {
     g_autoptr(virCgroup) parent = NULL;
     char *offset = path;
 
-    if (virCgroupNew(pidleader,
+    if (virCgroupNew(-1,
                      "/",
                      controllers,
                      &parent) < 0)
@@ -1213,10 +1212,8 @@ virCgroupNewMachineSystemd(const char *name,
         return -2;
     }
 
-    if (virCgroupEnableMissingControllers(path, pidleader,
-                                          controllers, &newGroup) < 0) {
+    if (virCgroupEnableMissingControllers(path, controllers, &newGroup) < 0)
         return -1;
-    }
 
     if (virCgroupAddProcess(newGroup, pidleader) < 0) {
         virErrorPtr saved;
-- 
2.26.2




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

  Powered by Linux