]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "util: cgroups do not implicitly add task to new machine cgroup"
authorJohn Ferlan <jferlan@redhat.com>
Thu, 14 Jan 2016 16:00:25 +0000 (11:00 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 14 Jan 2016 16:00:25 +0000 (11:00 -0500)
This reverts commit 71ce475967b3523882b0e1a0f649fdbea5abf9d5.

Since commit id 'a41c00b47' has been reverted, this no longer is
necessary

src/lxc/lxc_cgroup.c
src/qemu/qemu_cgroup.c
src/util/vircgroup.c

index ef332e365865ba83cb96b181e627e7834bcbc708..8f78d24b837e56b950503292892673e65d813c38 100644 (file)
@@ -504,17 +504,6 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
                             &cgroup) < 0 || !cgroup)
         goto cleanup;
 
-    if (virCgroupAddTask(cgroup, initpid) < 0) {
-        virErrorPtr saved = virSaveLastError();
-        virCgroupRemove(cgroup);
-        virCgroupFree(&cgroup);
-        if (saved) {
-            virSetError(saved);
-            virFreeError(saved);
-        }
-        goto cleanup;
-    }
-
     /* setup control group permissions for user namespace */
     if (def->idmap.uidmap) {
         if (virCgroupSetOwner(cgroup,
index 88c1ce2cc771d173dea0ba7064cf63db5d1f2bde..94b931fb4820c3e3760a623969ba28a162981cfb 100644 (file)
@@ -789,17 +789,6 @@ qemuInitCgroup(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    if (virCgroupAddTask(priv->cgroup, vm->pid) < 0) {
-        virErrorPtr saved = virSaveLastError();
-        virCgroupRemove(priv->cgroup);
-        virCgroupFree(&priv->cgroup);
-        if (saved) {
-            virSetError(saved);
-            virFreeError(saved);
-        }
-        goto cleanup;
-    }
-
  done:
     ret = 0;
  cleanup:
index 78f519c2c2aae828d80b5c98d35520b799d826a5..7584ee4c243d9c177281387da6c0c07e4ef42d0a 100644 (file)
@@ -1669,6 +1669,16 @@ virCgroupNewMachineSystemd(const char *name,
         }
     }
 
+    if (virCgroupAddTask(*group, pidleader) < 0) {
+        virErrorPtr saved = virSaveLastError();
+        virCgroupRemove(*group);
+        virCgroupFree(group);
+        if (saved) {
+            virSetError(saved);
+            virFreeError(saved);
+        }
+    }
+
     ret = 0;
  cleanup:
     virCgroupFree(&parent);
@@ -1691,6 +1701,7 @@ int virCgroupTerminateMachine(const char *name,
 static int
 virCgroupNewMachineManual(const char *name,
                           const char *drivername,
+                          pid_t pidleader,
                           const char *partition,
                           int controllers,
                           virCgroupPtr *group)
@@ -1716,6 +1727,16 @@ virCgroupNewMachineManual(const char *name,
                                     group) < 0)
         goto cleanup;
 
+    if (virCgroupAddTask(*group, pidleader) < 0) {
+        virErrorPtr saved = virSaveLastError();
+        virCgroupRemove(*group);
+        virCgroupFree(group);
+        if (saved) {
+            virSetError(saved);
+            virFreeError(saved);
+        }
+    }
+
  done:
     ret = 0;
 
@@ -1762,6 +1783,7 @@ virCgroupNewMachine(const char *name,
 
     return virCgroupNewMachineManual(name,
                                      drivername,
+                                     pidleader,
                                      partition,
                                      controllers,
                                      group);