]> 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>
Fri, 14 Aug 2015 17:16:12 +0000 (13:16 -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 2a254088a3591b75e9b26453e00b4669e8732987..2ae7bae72f4d65fccd1d405ecf2c378e80c28c73 100644 (file)
@@ -1412,16 +1412,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();