| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Don't want to have a segmentation fault for NULL data structures.
Just return an error to the caller.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@177 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using %lu and so on, use the inttype.h macro to define
types. Will ensure compatibility across platforms.
Please review more closely.
Tested by compiling with and without -m32 on a 64 bit system.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@176 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with a modified version of libcg_ba (basic acceptance tests), that I'll send
out later. I've also fixed a couple of bugs, I'll list them in order and
if desired, I'll split out the patches so that the enhancements can be
separate from the bug fixes
1. Fix cg_create_control_group() to succeed if the directory already exists
2. We can't always append a control_file, we need to open it "r+"
3. It's OK for writing values to a control_file to fail, since some of
them are read-only and some may not exist in hierarchies below the root
4. Skip over directories while trying to read control file's name value pairs
5. In cg_rd_ctlr_file we don't allocate any memory to value, directly fscanf
into it, that's been fixed
6. There might be more fixes that might already be present in trunk, since
I hope I've not redone a lot of the fixes, I had branched of trunk very
recently
Changelog v2
------------
1. Refactor cgroup_free_controllers() and use it in
cgroup_create_cgroup_from_parent()
2. Check for strdup failure
3. Check if dst == src
TODO:
1. Use cg_add_controller() API
2. Use cg_add_value_string() API
I'll send out patches for the TODOs later.
I've also updated the basic acceptance test (libcg_ba.cpp)
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@165 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use calloc to allocate memory.
Should get rid of a number of silent memory corruptions.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Dan Smith <danms@us.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@142 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding in APIs which allow you to set and get values from a cgroup
controller. Use cgroup_get_controller to get a controller, and then
use cgroup_?et_value_* API for your requirement.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@126 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch breaks API. There are no known users at the moment so
it is fine.
cgroup_new_cgroup now takes in only a name argument. The uids and
gids are set by a new API, cgroup_?et_uid_gid()
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@125 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
| |
Allows you to compare two cgroups. Their values need to be
equal. NULL cgroups are invalid.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@124 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following warnings
wrapper.c: In function ‘cgroup_add_value_int64’:
wrapper.c:152: warning: format ‘%lld’ expects type ‘long long int’, but argument 4 has type ‘int64_t’
wrapper.c:152: warning: format ‘%lld’ expects type ‘long long int’, but argument 4 has type ‘int64_t’
wrapper.c: In function ‘cgroup_add_value_uint64’:
wrapper.c:186: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘u_int64_t’
wrapper.c:186: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘u_int64_t’
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@122 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a horrible bug in wrapper.c. The loop was causing a segmentation
fault. This is because we were checking for index value as opposed to
i.
This bug was not hit before, because in all our testing, we were
trying out only with CONFIG_FAIR_GROUP_SCHED and we were setting only one
value inside the memory subsystem.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@121 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dan Smith reported some segmentation faults. It turns out that we did
not NULL terminate all the structures when we had moved to the wrapper
based approach. With this in mind, the loop checks the index instead
of a NULL structure.
Also remove unwanted NULL terminations.
Thanks to Dan for excellent debugging.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/tags/v0.1c@77 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|
|
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/tags/v0.1b@49 4f4bb910-9a46-0410-90c8-c897d4f1cd53
|