Since the only way to create a controller is from the wrapper API, it is
always linked to one cgroup. Since it would help knowing which cgroup a
controller belongs to, let's just add that information in there.

Signed-off-by: Dhaval Giani <dhaval.gi...@gmail.com>
Cc: Glauber Costa <glom...@parallels.com>

diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
index 1b3daf9..7b2ca48 100644
--- a/src/libcgroup-internal.h
+++ b/src/libcgroup-internal.h
@@ -76,6 +76,7 @@ struct control_value {
 struct cgroup_controller {
        char name[FILENAME_MAX];
        struct control_value *values[CG_NV_MAX];
+       struct cgroup *cgroup;
        int index;
 };
 
diff --git a/src/wrapper.c b/src/wrapper.c
index f1eec77..042811f 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -83,6 +83,7 @@ struct cgroup_controller *cgroup_add_controller(struct cgroup 
*cgroup,
                return NULL;
 
        strncpy(controller->name, name, sizeof(controller->name));
+       controller->cgroup = cgroup;
        controller->index = 0;
 
        cgroup->controller[cgroup->index] = controller;



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to