Commit 27be5731 by Serge Hallyn Committed by Stéphane Graber

cgmanager: attach: never use 'all' controller

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: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent de0dc533
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment