[lxc-devel] [PATCH 2/1] implement cgmanager_remove_cgroup
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Jan 15 18:09:18 UTC 2014
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
src/lxc/cgmanager.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
index 92745dc..53a1802 100644
--- a/src/lxc/cgmanager.c
+++ b/src/lxc/cgmanager.c
@@ -130,10 +130,15 @@ struct cgm_data {
char *cgroup_path;
};
-void cgmanager_remove_cgroup(const char *subsystem, const char *path)
+#define CG_REMOVE_RECURSIVE 1
+void cgmanager_remove_cgroup(const char *controller, const char *path)
{
- // TODO implement
- WARN("%s: not yet implemented", __func__);
+ int existed;
+ if ( cgmanager_remove_sync(NULL, cgroup_manager, controller,
+ path, CG_REMOVE_RECURSIVE, &existed) != 0)
+ ERROR("Error removing %s:%s", controller, path);
+ if (!existed)
+ INFO("cgroup removal attempt: %s:%s did not exist");
}
static void cgm_destroy(struct lxc_handler *handler)
--
1.8.5.2
More information about the lxc-devel
mailing list