Skip to content

Commit

Permalink
cgmanager: attach: never use 'all' controller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hallyn authored and stgraber committed Jul 1, 2015
1 parent 02f3244 commit 499b4e1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lxc/cgmanager.c
Expand Up @@ -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();
Expand Down

0 comments on commit 499b4e1

Please sign in to comment.