[lxc-devel] [PATCH] cgmanager: attach: never use 'all' controller

Serge Hallyn serge.hallyn at ubuntu.com
Wed May 27 10:05:16 UTC 2015


We were using 'all' controller if current was in all the
same cgroup.  That doesn't suffice.  We'd have to check
the target.  At that point we may as well just attach
controller by controller.

An optimization to consider is to check the /proc/initpid/cgroup
for all identical controllers.  Let's start by just getting it
right.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/cgmanager.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
index 7dddb89..859143c 100644
--- a/src/lxc/cgmanager.c
+++ b/src/lxc/cgmanager.c
@@ -1311,16 +1311,8 @@ static bool cgm_attach(const char *name, const char *lxcpath, pid_t pid)
 		return false;
 	}
 
-	check_supports_multiple_controllers(pid);
-
-	if (cgm_all_controllers_same)
-		slist = subsystems_inone;
-
 	for (i = 0; slist[i]; i++) {
-		if (slist == subsystems_inone)
-			cgroup = try_get_abs_cgroup(name, lxcpath, subsystems[0]);
-		else
-			cgroup = try_get_abs_cgroup(name, lxcpath, slist[i]);
+		cgroup = try_get_abs_cgroup(name, lxcpath, slist[i]);
 		if (!cgroup) {
 			ERROR("Failed to get cgroup for controller %s", slist[i]);
 			cgm_dbus_disconnect();
-- 
2.1.4



More information about the lxc-devel mailing list