]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgmanager: attach: never use 'all' controller
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 27 May 2015 10:05:16 +0000 (10:05 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 17:41:07 +0000 (13:41 -0400)
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@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgmanager.c

index 48b81d9dc1d64449b1c822e45bed1bd74004affa..6b6c2d878918e42eec8869f82a25406c26b26308 100644 (file)
@@ -1430,16 +1430,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();