]> xenbits.xensource.com Git - libvirt.git/commitdiff
vircgroup: drop @pid argument from virCgroupNew
authorPavel Hrdina <phrdina@redhat.com>
Thu, 15 Oct 2020 15:05:17 +0000 (17:05 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 3 Nov 2020 20:26:32 +0000 (21:26 +0100)
Now it is always -1.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/vircgroup.c
src/util/vircgrouppriv.h
src/util/vircgroupv1.c

index 2c1d6f9f01e0c3208bd7781f705bc427d4e29018..6a34eb40379dcf03e6de15b53e28bfdfec6dd855 100644 (file)
@@ -671,15 +671,14 @@ virCgroupMakeGroup(virCgroupPtr parent,
  * Returns 0 on success, -1 on error
  */
 int
-virCgroupNew(pid_t pid,
-             const char *path,
+virCgroupNew(const char *path,
              int controllers,
              virCgroupPtr *group)
 {
     g_autoptr(virCgroup) newGroup = NULL;
 
-    VIR_DEBUG("pid=%lld path=%s controllers=%d group=%p",
-              (long long) pid, path, controllers, group);
+    VIR_DEBUG("path=%s controllers=%d group=%p",
+              path, controllers, group);
 
     *group = NULL;
     newGroup = g_new0(virCgroup, 1);
@@ -694,11 +693,11 @@ virCgroupNew(pid_t pid,
         return -1;
 
     /* ... but use /proc/cgroups to fill in the rest */
-    if (virCgroupDetectPlacement(newGroup, pid, path) < 0)
+    if (virCgroupDetectPlacement(newGroup, -1, path) < 0)
         return -1;
 
     /* Check that for every mounted controller, we found our placement */
-    if (virCgroupValidatePlacement(newGroup, pid) < 0)
+    if (virCgroupValidatePlacement(newGroup, -1) < 0)
         return -1;
 
     if (virCgroupDetectControllers(newGroup, controllers, NULL) < 0)
@@ -905,7 +904,7 @@ virCgroupNewPartition(const char *path,
         tmp++;
         *tmp = '\0';
 
-        if (virCgroupNew(-1, parentPath, controllers, &parent) < 0)
+        if (virCgroupNew(parentPath, controllers, &parent) < 0)
             return -1;
     }
 
@@ -1118,8 +1117,7 @@ virCgroupEnableMissingControllers(char *path,
     g_autoptr(virCgroup) parent = NULL;
     char *offset = path;
 
-    if (virCgroupNew(-1,
-                     "/",
+    if (virCgroupNew("/",
                      controllers,
                      &parent) < 0)
         return -1;
index 0ac62882a58960026b46cbf0ab70091413b6a035..7248bc1d35aa16428b24d5dc181b3e53ee200bca 100644 (file)
@@ -110,8 +110,7 @@ int virCgroupGetValueForBlkDev(const char *str,
                                const char *devPath,
                                char **value);
 
-int virCgroupNew(pid_t pid,
-                 const char *path,
+int virCgroupNew(const char *path,
                  int controllers,
                  virCgroupPtr *group);
 
index b3e0f733b9fae3cb392c7ae890fd4189eee5a74a..98b5aa047d20de96b9269a69e70d49afecad24dd 100644 (file)
@@ -1468,7 +1468,7 @@ virCgroupV1MemoryOnceInit(void)
     g_autoptr(virCgroup) group = NULL;
     unsigned long long int mem_unlimited = 0ULL;
 
-    if (virCgroupNew(-1, "/", -1, &group) < 0)
+    if (virCgroupNew("/", -1, &group) < 0)
         return;
 
     if (!virCgroupV1HasController(group, VIR_CGROUP_CONTROLLER_MEMORY))