chiark / gitweb /
cgroup: add cgroup_bonding_to_string() call
authorLennart Poettering <lennart@poettering.net>
Sun, 18 Apr 2010 01:04:54 +0000 (03:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 18 Apr 2010 01:04:54 +0000 (03:04 +0200)
cgroup.c
cgroup.h

index 24bbe1a..f5c2592 100644 (file)
--- 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;
+}
index b7e18bf..6b677d5 100644 (file)
--- 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);