From 27be573155c3f6559db22b446e6cb10cb7e5ab54 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 27 May 2015 10:05:16 +0000 Subject: [PATCH] cgmanager: attach: never use 'all' controller MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Stéphane Graber --- 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 48b81d9dc..6b6c2d878 100644 --- a/src/lxc/cgmanager.c +++ b/src/lxc/cgmanager.c @@ -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(); -- 2.47.2