summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-18 03:04:54 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-18 03:04:54 +0200
commit6dde1f33e1249a8a6b354372dd95065f26b8c712 (patch)
treee6f18bfd580567b95c76f978d70918254c2a3868
parentac86f50d7b62fb16b4521c87bd2739b9c26a4f60 (diff)
cgroup: add cgroup_bonding_to_string() call
-rw-r--r--cgroup.c11
-rw-r--r--cgroup.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/cgroup.c b/cgroup.c
index 24bbe1aa15..f5c2592ce8 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -540,3 +540,14 @@ CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *contro
return NULL;
}
+
+char *cgroup_bonding_to_string(CGroupBonding *b) {
+ char *r;
+
+ assert(b);
+
+ if (asprintf(&r, "%s:%s", b->controller, b->path) < 0)
+ return NULL;
+
+ return r;
+}
diff --git a/cgroup.h b/cgroup.h
index b7e18bf620..6b677d535d 100644
--- a/cgroup.h
+++ b/cgroup.h
@@ -70,6 +70,8 @@ int cgroup_bonding_is_empty_list(CGroupBonding *first);
CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *controller);
+char *cgroup_bonding_to_string(CGroupBonding *b);
+
#include "manager.h"
int manager_setup_cgroup(Manager *m);