]> git.ipfire.org Git - thirdparty/libcgroup.git/log
thirdparty/libcgroup.git
15 years agoadd the return value check in lssubsys II
Ivana Hutarova Varekova [Wed, 28 Jul 2010 12:11:53 +0000 (14:11 +0200)] 
add the return value check in lssubsys II

This patch add one return value check for lssubsys

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoadd the return value check in lssubsys I
Ivana Hutarova Varekova [Wed, 28 Jul 2010 12:11:45 +0000 (14:11 +0200)] 
add the return value check in lssubsys I

This patch add one return value check for lssubsys

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agolssubsys patch - adds omit controllers
Ivana Hutarova Varekova [Wed, 28 Jul 2010 12:11:33 +0000 (14:11 +0200)] 
lssubsys patch - adds omit controllers

Changes from previous version:
* put the return value check to separate subpackages
* change the test (info.hierarchy == hierarchy) to
 (info.hierarchy != hierarchy) to decrease the nesting depth
* use memset

This patch fixes lssubsys output - it fixes two problems:
1/ if there was subsystem attached to not-mounted hierarchy then
lssubsys -a
does not show this subsystems
EXAMPLE:

BROKEN:
$ ./lssubsys -am
cpuset
cpuacct /cgroup/memoryd
memory /cgroup/memory
freezer
net_cls /cgroup/net_cls

FIXED:
$ ./lssubsys -am
cpuset
ns <- controller is in hierarchy but it is not mounted
cpu,devices <- controller is in hierarchy but it is not mounted
cpuacct /cgroup/memoryd
memory /cgroup/memory
freezer
net_cls /cgroup/net_cls

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoFix initscript exit codes.
Jan Safranek [Mon, 2 Aug 2010 14:30:45 +0000 (16:30 +0200)] 
Fix initscript exit codes.

Fix initscript exit codes
 - propagate errors from functions to final exit status
 - use exit status '1' for generic errors
 - return status '2' when the service is called with unknown arguments

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agolibcgroup: Test case for get_procs
Dhaval Giani [Tue, 27 Jul 2010 11:55:55 +0000 (13:55 +0200)] 
libcgroup: Test case for get_procs

Test for the get_procs API.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Get the list of procs
Dhaval Giani [Tue, 27 Jul 2010 11:51:36 +0000 (13:51 +0200)] 
libcgroup: Get the list of procs

This patch adds a new API to get a list of procs. This is
guaranteed to be sorted.

TODO:
1. Ensure only unique values make it through

[balbir@linux.vnet.ibm.com: Add a missing EOF check]
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoUpdate documentation with the new return values
Eric Brower [Tue, 27 Jul 2010 05:49:37 +0000 (22:49 -0700)] 
Update documentation with the new return values

Header file documentation changes; cgroup_create_cgroup() and
cgroup_create_cgroup_from_parent() return ECGROUPNOTEQUAL when create
is successful, but not all controller parameters are successfully
copied.

Signed-off-by: Eric Brower <ebrower@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agocheck for unconfigured cgroup in cgroup_find_parent
Eric Brower [Tue, 27 Jul 2010 05:51:23 +0000 (22:51 -0700)] 
check for unconfigured cgroup in cgroup_find_parent

Check for cgroup without controllers to prevent segfault, as the
current implementation depends upon a controller being configured.

Signed-off-by: Eric Brower <ebrower@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agosplit on-disk cgroup validation from parent name generation
Eric Brower [Tue, 27 Jul 2010 05:50:40 +0000 (22:50 -0700)] 
split on-disk cgroup validation from parent name generation

Split cgroup_find_parent cgroup/parent on-disk validation from cgroup parent
name generation.  This solves a chicken-and-egg problem for callers that need
to obtain a parent name from a cgroup that has not yet been created, such as
cgroup_create_cgroup_from_parent().  The new function enforces the documented
behavior (return NULL) when a "root" cgroup is specified.

Modify cgroup_create_cgroup_from_parent() to use this new function, and clean up
a few possibly-erroneous return values.

Signed-off-by: Eric Brower <ebrower@gmail.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoReturn ECGROUPNOTEQUAL to indicate partial create success
Eric Brower [Tue, 27 Jul 2010 05:49:16 +0000 (22:49 -0700)] 
Return ECGROUPNOTEQUAL to indicate partial create success

Return ECGROUPNOTEQUAL when copying controller parameters fails--
this allows callers to differentiate between cgroup creation failures and
controller configuration failures, and makes explicit that this function
can return an error code but still have created the cgroup.  Callers,
such as cgroup_create_cgroup_from_parent(), can now explicitly ignore
(the unfortunately expected) controller configuration errors.

Signed-off-by: Eric Brower <ebrower@gmail.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoInit scripts patch
Ivana Hutarova Varekova [Wed, 14 Jul 2010 12:30:48 +0000 (14:30 +0200)] 
Init scripts patch

This patch fixes the return values to meet the standarts.

changed values are:
cgconfig:
 * start  action: 6: program is not configured
 * status action: 3: program is not running

cgred:
 * start  action: 7: program is not running
 * start  action: 6: program is not configured
 * status action: 3: program is not running
 * status action: 2: program is dead and /var/run pid file exists
 * stop   action: 0: if the service is not running

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix overlaping src and dest buffers in sprintf()
Jan Safranek [Mon, 7 Jun 2010 09:58:46 +0000 (11:58 +0200)] 
Fix overlaping src and dest buffers in sprintf()

libcgroup compiled with various optimization flags produce strange results
when sprintf's destination and source pointers overlap or are the same.

In addition, use strncpy() instead. This is more or less useless, because
cg_build_path() does not check sizes either, but just for my personal feeling
of correct C code...

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoCheck return value of cgroup_read_stats_begin
Jan Safranek [Mon, 7 Jun 2010 09:58:37 +0000 (11:58 +0200)] 
Check return value of cgroup_read_stats_begin

Check return value of cgroup_read_stats_begin.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix memory leak in cgroup_read_stats iterator
Jan Safranek [Mon, 7 Jun 2010 09:58:19 +0000 (11:58 +0200)] 
Fix memory leak in cgroup_read_stats iterator

getline(&line, ...) can return -1 *and* allocate memory for returned (empty)
line - so be sure to free it.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix return code of cgroup_read_stats_XXX iterator
Jan Safranek [Mon, 7 Jun 2010 09:58:28 +0000 (11:58 +0200)] 
Fix return code of cgroup_read_stats_XXX iterator

Fix return code of cgroup_read_stats_XXX iterator.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agov0.36.2 v0.36.2
Dhaval Giani [Mon, 21 Jun 2010 10:26:32 +0000 (12:26 +0200)] 
v0.36.2

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix a bug in lscgroup which prevent it from reading cgroups from
Balbir Singh [Thu, 17 Jun 2010 14:04:21 +0000 (19:34 +0530)] 
Fix a bug in lscgroup which prevent it from reading cgroups from
output.

Signed-off-by: Ivana Hutarova Varekova<varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoMerge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg
Balbir Singh [Mon, 7 Jun 2010 10:35:42 +0000 (16:05 +0530)] 
Merge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg

15 years agov0.36.2.rc
Dhaval Giani [Fri, 4 Jun 2010 11:42:29 +0000 (13:42 +0200)] 
v0.36.2.rc

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: open files with O_CLOEXEC
Dhaval Giani [Fri, 4 Jun 2010 11:30:59 +0000 (13:30 +0200)] 
libcgroup: open files with O_CLOEXEC

We don't want file handles to remain open across execs.
Therefore open files with the O_CLOEXEC flag which closes
the files on exec.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Do not call exit from within the main library
Dhaval Giani [Fri, 4 Jun 2010 11:30:58 +0000 (13:30 +0200)] 
libcgroup: Do not call exit from within the main library

The autogenerated code fromt the lexer was calling exit on a
fatal error. Do not do that. Instead log the message.

While it is still not clear if this is the correct response
for YY_FATAL_ERROR, we need to gracefully handle errors, and
since this is a path which is very rarely hit, this is still
a low risk change and so we will merge it.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoAdd configure option to set destination directory of pam module.
Jan Safranek [Mon, 31 May 2010 15:15:22 +0000 (17:15 +0200)] 
Add configure option to set destination directory of pam module.

Add configure option to set destination directory of pam module. The module
can be used right after 'make install', no moving of libraries is required.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMake the installation of init scripts optional
Jan Safranek [Mon, 31 May 2010 15:15:15 +0000 (17:15 +0200)] 
Make the installation of init scripts optional

Some distros do not like 'make install' to install also initscripts. So
let's make it configurable with --enable-initscripts-install.

The default behavior is not to install them - they probably work only on
Fedora.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoRework the way how the libraries are installed.
Jan Safranek [Mon, 31 May 2010 15:15:08 +0000 (17:15 +0200)] 
Rework the way how the libraries are installed.

As pointed out by Kay Sievers on IRC, the pkgconfig file should point to
/usr/lib, where libcgroup.so symlink is located, not to /lib, where is the
real library libcgroup.so.1.0.36.

Therefore it's better to install libraries to /usr/lib, which generated
the right libcgroup.pc and then move all necessary libs to /lib.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Return correct values in parse.y
Dhaval Giani [Tue, 1 Jun 2010 15:36:38 +0000 (17:36 +0200)] 
libcgroup: Return correct values in parse.y

Instead of returning a valid error on failure in parse.y, we
were returning 0. Fix that up.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoreplace /etc with $(sysconfdir) to pass 'make distcheck'
Kay Sievers [Mon, 31 May 2010 22:07:28 +0000 (00:07 +0200)] 
replace /etc with $(sysconfdir) to pass 'make distcheck'

Distcheck checks for correct use of DESTDIR and prefix. We need to
include a path that contains prefix instead of plain /etc.

Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dhaval Giani <dhaval@gondor.retis>
15 years agoadd generated file to CLEANFILES
Kay Sievers [Mon, 31 May 2010 15:21:32 +0000 (17:21 +0200)] 
add generated file to CLEANFILES

Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dhaval Giani <dhaval@gondor.retis>
15 years agosrcdir -> builddir to fix 'make distcheck'
Kay Sievers [Mon, 31 May 2010 15:08:38 +0000 (17:08 +0200)] 
srcdir -> builddir to fix 'make distcheck'

Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dhaval Giani <dhaval@gondor.retis>
15 years agodepend on parse.h to allow 'make -j'
Kay Sievers [Mon, 31 May 2010 14:53:53 +0000 (16:53 +0200)] 
depend on parse.h to allow 'make -j'

Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dhaval Giani <dhaval@gondor.retis>
15 years agoAdd several man-pages to their Makefile
Ivana Hutarova Varekova [Wed, 26 May 2010 09:30:49 +0000 (11:30 +0200)] 
Add several man-pages to their Makefile

This patch adds several man-pages which already are in git to
Makefile.

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@gondor.retis>
15 years agov0.36.1 v0.36.1
Dhaval Giani [Fri, 21 May 2010 12:31:01 +0000 (14:31 +0200)] 
v0.36.1

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agov0.36.1.rc1
Dhaval Giani [Tue, 18 May 2010 13:30:42 +0000 (15:30 +0200)] 
v0.36.1.rc1

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcg trivial compile errors/warnings
Kay Sievers [Tue, 18 May 2010 05:23:17 +0000 (07:23 +0200)] 
libcg trivial compile errors/warnings

libcgroup: Fix a few cosmetic issues and missing include

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMerge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg
Balbir Singh [Tue, 18 May 2010 13:23:04 +0000 (18:53 +0530)] 
Merge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg

15 years agolibcgroup tests: Fix build issue with the named hierarchy test case
Dhaval Giani [Mon, 17 May 2010 22:30:12 +0000 (00:30 +0200)] 
libcgroup tests: Fix build issue with the named hierarchy test case

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agov0.36 v0.36
Dhaval Giani [Mon, 17 May 2010 21:53:33 +0000 (23:53 +0200)] 
v0.36

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Test the modified cgroup_init
Dhaval Giani [Mon, 17 May 2010 16:54:49 +0000 (18:54 +0200)] 
libcgroup: Test the modified cgroup_init

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Add support for named hierarchies.
Dhaval Giani [Mon, 17 May 2010 16:54:48 +0000 (18:54 +0200)] 
libcgroup: Add support for named hierarchies.

This feature has been available in the kernel for sometime, but was missed by
libcgroup.

Add support for named hierarchies. The controller is identified as
name=<name> and used in such fashion.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Introduce cgroup_basename and modify the functions to use it.
Dhaval Giani [Mon, 17 May 2010 16:15:59 +0000 (18:15 +0200)] 
libcgroup: Introduce cgroup_basename and modify the functions to use it.

basename() is not safe as it modifies the pointers from time to time.

In order to prevent it, write a safe version of basename which uses basename
internally.

As a side effect, it also clears up the following warning,

api.c: In function â€˜cgroup_find_matching_rule’:
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’
api.c:2201: warning: passing argument 1 of â€˜__xpg_basename’ discards qualifiers from pointer target type
/usr/include/libgen.h:35: note: expected â€˜char *’ but argument is of type â€˜const char *’

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Fix warnings warning about comparisions between signed and unsigned integers
Dhaval Giani [Mon, 17 May 2010 16:15:58 +0000 (18:15 +0200)] 
libcgroup: Fix warnings warning about comparisions between signed and unsigned integers

Fix warnings such as

api.c:539: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
api.c:539: warning: signed and unsigned type in conditional expression [-Wsign-compare]

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Fix warnings warning of shadowed declaration
Dhaval Giani [Mon, 17 May 2010 16:15:57 +0000 (18:15 +0200)] 
libcgroup: Fix warnings warning of shadowed declaration

Fixes warnings such as

api.c:2764: warning: declaration of â€˜stat’ shadows a global declaration [-Wshadow]
/usr/include/sys/stat.h:453: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Fix warnings warning about mixed declarations
Dhaval Giani [Mon, 17 May 2010 16:15:56 +0000 (18:15 +0200)] 
libcgroup: Fix warnings warning about mixed declarations

Fix warnings like

api.c: In function â€˜cgroup_walk_tree_begin’:
api.c:2647: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: cast CGRULE macros to uid_t
Dhaval Giani [Mon, 17 May 2010 16:15:55 +0000 (18:15 +0200)] 
libcgroup: cast CGRULE macros to uid_t

Clears up a few warnings.

api.c:2366: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
api.c:2368: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
api.c:2373: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
api.c:2375: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Compress the large_cgconfig.conf file
Dhaval Giani [Thu, 6 May 2010 15:47:57 +0000 (17:47 +0200)] 
libcgroup: Compress the large_cgconfig.conf file

The large_cgconfig.conf file is 276kb in size. Compress it
so that it takes lesser space.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoAllow cgroup_config_table to be dynamically handled
Balbir Singh [Fri, 30 Apr 2010 17:23:18 +0000 (22:53 +0530)] 
Allow cgroup_config_table to be dynamically handled

Allow cgconfigparser to create groups > MAX_GROUPS

From: Balbir Singh <balbir@linux.vnet.ibm.com>

Rafael Tinoco <rafael.tinoco@locaweb.com.br> noticed that the maximum
number of cgroups created using cgconfigparser fell short of 2000. Balbir
found a limitation in the code, that limited this number to a predefined
maximum. This patch fixes the limitation, although not in the most
optimized way, since we want to avoid double parsing of the configuraiton
file.

This patch realloc's the data structure that holds parsed cgroups.

Tested via setting MAX_CGROUPS=1 and loading a configuration file with
2 groups defined. Also tested with a large cgroup file

Test results after loading large_cgconfig.conf (generated using a
script). The size is large, but I wanted to send out the test case
since it adds to our regression bucket.

#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
ns      0       1       1
cpu     1       2021    1
cpuacct 1       2021    1
memory  2       2021    1
devices 0       1       1
freezer 0       1       1
net_cls 0       1       1

NOTE: Be careful, such a large number of groups could slow
down your system. This needs further investigation at the cgroups
layer in the kernel.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agomanpages: Fix whitespace in cgred.conf manpage
Dhaval Giani [Thu, 6 May 2010 12:46:12 +0000 (14:46 +0200)] 
manpages: Fix whitespace in cgred.conf manpage

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoSeveral man-page fixes
Ivana Hutarova Varekova [Thu, 6 May 2010 12:44:48 +0000 (14:44 +0200)] 
Several man-page fixes

This patch fixes several man pages (typos, syntax problems)

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoUse int for getopt() results
Jan Safranek [Mon, 12 Apr 2010 10:49:08 +0000 (12:49 +0200)] 
Use int for getopt() results

On ppc, char is unsigned and getopt()/getopt_long() returning -1 (= end of
arguments) is translated to 255 and results in 'Invalid command line option'.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMerge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg
Balbir Singh [Tue, 30 Mar 2010 15:06:17 +0000 (20:36 +0530)] 
Merge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg

15 years agoMerge branch 'devel/doxygen3' of git://fedorapeople.org/~jsafrane/libcg
Dhaval Giani [Mon, 29 Mar 2010 10:29:22 +0000 (12:29 +0200)] 
Merge branch 'devel/doxygen3' of git://fedorapeople.org/~jsafrane/libcg

15 years agoAdd documentation main page
Jan Safranek [Mon, 29 Mar 2010 10:07:00 +0000 (12:07 +0200)] 
Add documentation main page

Add very simple main page to include/libcgroup.h. It contains just very
basic info and links to the other modules. Feel free to elaborate more on
this, it could contain lot more:
 - how to complie with libcgroup (=pkgconfig)?
 - how to report errors
 - links to samples
 - link to home page
 - info about threading
 etc.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoDocument the tasks.h
Jan Safranek [Mon, 29 Mar 2010 10:05:11 +0000 (12:05 +0200)] 
Document the tasks.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoUpdate config.h
Jan Safranek [Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)] 
Update config.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoDocument the iterators
Jan Safranek [Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)] 
Document the iterators

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoAdd doc to include/libcgroup/error.h
Jan Safranek [Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)] 
Add doc to include/libcgroup/error.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoAdd documentation to include/libcgroup/init.h
Jan Safranek [Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)] 
Add documentation to include/libcgroup/init.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoDocument include/libcgroup/groups.h
Jan Safranek [Mon, 29 Mar 2010 10:00:42 +0000 (12:00 +0200)] 
Document include/libcgroup/groups.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agoUpdate doxygen config file
Jan Safranek [Mon, 29 Mar 2010 10:00:41 +0000 (12:00 +0200)] 
Update doxygen config file

Update doxygen config file to 1.6.1 + add comments + change following
settings:

OUTPUT_DIRECTORY = doc/generated
ALWAYS_DETAILED_SEC = YES - we want all function in detailed list
JAVADOC_AUTOBRIEF = YES - IMHO the least painfull way to extract brief
desxcription, see doxygen docs for the other ways. But still painful enough :(
OPTIMIZE_OUTPUT_FOR_C  = YES - we're C project
IDL_PROPERTY_SUPPORT   = NO - we're C project
WARN_NO_PARAMDOC = YES - document all function parameters please!
INPUT = include - generate public docs only
GENERATE_LATEX = NO - no LaTeX for now, maybe later
*_GRAPH = NO - no call/include graphs in public docs

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
15 years agolibcgroup: Fix coding style issues in config.c
Dhaval Giani [Fri, 26 Mar 2010 14:04:36 +0000 (15:04 +0100)] 
libcgroup: Fix coding style issues in config.c

Pre:
total: 1 errors, 10 warnings, 817 lines checked

Post:
total: 0 errors, 4 warnings, 818 lines checked

Unfixed warnings are because they break text and therefore capabilities
to easily grep through.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Fix up coding style in wrapper.c
Dhaval Giani [Fri, 26 Mar 2010 14:04:35 +0000 (15:04 +0100)] 
libcgroup: Fix up coding style in wrapper.c

Pre:
total: 0 errors, 3 warnings, 638 lines checked

Post:
total: 0 errors, 0 warnings, 640 lines checked

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Dont assign values to variables inside if conditions
Dhaval Giani [Fri, 26 Mar 2010 14:04:34 +0000 (15:04 +0100)] 
libcgroup: Dont assign values to variables inside if conditions

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Fix coding style issues in api.c
Dhaval Giani [Fri, 26 Mar 2010 14:04:33 +0000 (15:04 +0100)] 
libcgroup: Fix coding style issues in api.c

Pre this patch
total: 16 errors, 40 warnings, 3321 lines checked

Post this patch
total: 2 errors, 5 warnings, 3323 lines checked

The remaining errors will cause a code change, and so go in a separate patch.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agodon't export functions that should not be exported
Lennart Poettering [Wed, 24 Mar 2010 20:05:23 +0000 (21:05 +0100)] 
don't export functions that should not be exported

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agocgget: properly use binary & instead of boolean && when checking for flags
Lennart Poettering [Wed, 24 Mar 2010 20:05:08 +0000 (21:05 +0100)] 
cgget: properly use binary & instead of boolean && when checking for flags

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoconfig: don't implicitly import cgroup_config_cleanup_namespace_table(), this is...
Lennart Poettering [Wed, 24 Mar 2010 20:04:54 +0000 (21:04 +0100)] 
config: don't implicitly import cgroup_config_cleanup_namespace_table(), this is not K&R C anymore...

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoapi: don't keep one copy of the mount table per .c file
Lennart Poettering [Wed, 24 Mar 2010 20:04:36 +0000 (21:04 +0100)] 
api: don't keep one copy of the mount table per .c file

The mount table variables need to be declared in the header file and
defined in the .c file. If we don't do that every .o file will end up
with its own copy of those variables.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agounexport a couple of variables that don't need to be exported
Lennart Poettering [Wed, 24 Mar 2010 20:04:22 +0000 (21:04 +0100)] 
unexport a couple of variables that don't need to be exported

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agopkg-config: hide .pc file from git
Lennart Poettering [Wed, 24 Mar 2010 20:04:09 +0000 (21:04 +0100)] 
pkg-config: hide .pc file from git

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoapi: bzero is obsolete BSD, use memset instead
Lennart Poettering [Wed, 24 Mar 2010 20:03:56 +0000 (21:03 +0100)] 
api: bzero is obsolete BSD, use memset instead

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoconfig: pass struct as const call-by-ref instead of call-by-value, to minimize copying
Lennart Poettering [Wed, 24 Mar 2010 20:03:42 +0000 (21:03 +0100)] 
config: pass struct as const call-by-ref instead of call-by-value, to minimize copying

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoconfig: use macros instead of arrays for const strings
Lennart Poettering [Wed, 24 Mar 2010 20:03:24 +0000 (21:03 +0100)] 
config: use macros instead of arrays for const strings

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agomake functions without arguments proper C99 functions
Lennart Poettering [Wed, 24 Mar 2010 20:03:04 +0000 (21:03 +0100)] 
make functions without arguments proper C99 functions

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoadd a couple of FIXMEs to broken code
Lennart Poettering [Wed, 24 Mar 2010 19:59:42 +0000 (20:59 +0100)] 
add a couple of FIXMEs to broken code

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoadd const where applicable, drop const where unnecessary
Lennart Poettering [Wed, 24 Mar 2010 18:06:49 +0000 (19:06 +0100)] 
add const where applicable, drop const where unnecessary

This patch adds the const qualifier to a number of function arguments
(mostly string arguments) so that client libraries can pass their own
const strings to the library without having to cast their const'ness
away.

This also drops a couple of consts where call-by-value is done anyway,
and which hence has no effect and just misleads the users and adds
unnecessary noise to the signal. After all this is C, not C++.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMerge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg
Balbir Singh [Thu, 25 Mar 2010 06:11:05 +0000 (11:41 +0530)] 
Merge branch 'master' of ssh://libcg.git.sf.net/gitroot/libcg/libcg

15 years agogit: hide all generated files from git
Lennart Poettering [Wed, 24 Mar 2010 14:53:05 +0000 (15:53 +0100)] 
git: hide all generated files from git

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoinclude: refuse inclusion of seperate header files
Lennart Poettering [Wed, 24 Mar 2010 14:51:55 +0000 (15:51 +0100)] 
include: refuse inclusion of seperate header files

Later on it might make sense to move around function definitions between
header files. Hence make sure that nobody includes any header file
directly except the main one.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agobuild-sys: add bootstrap.sh
Lennart Poettering [Wed, 24 Mar 2010 14:52:23 +0000 (15:52 +0100)] 
build-sys: add bootstrap.sh

Most projects carry a bootstrap.sh/autogen.sh file that calls the
autotools in the right order.

This bootstrap.sh also enables the default git commit hook which
enforces a strict kernel-like whitespace regime.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agobuild-sys: enable silent build by default
Lennart Poettering [Wed, 24 Mar 2010 14:51:38 +0000 (15:51 +0100)] 
build-sys: enable silent build by default

Make the automake output a bit more like the kbuild output if supported.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Add pkg-config data
Dhaval Giani [Thu, 18 Feb 2010 14:56:31 +0000 (15:56 +0100)] 
libcgroup: Add pkg-config data

libcgroup was not making an entry into the pkg-config database, which
makes life easier when using multiple libraries. Add the needed data
in order to be registered with the pkg-config database on installation.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
Reviewed-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Lennart Poettering <lennnart@poettering.net>
15 years agolibcgroup: Version bump to v0.36.rc1
Dhaval Giani [Thu, 18 Feb 2010 14:56:30 +0000 (15:56 +0100)] 
libcgroup: Version bump to v0.36.rc1

We are now making changes to the specfile, which needs a version
bump. Bump up the version to v0.36.rc1.

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix typo in wrapper.c (cgroup_get_uid_gid)
Balbir Singh [Wed, 24 Mar 2010 07:18:45 +0000 (12:48 +0530)] 
Fix typo in wrapper.c (cgroup_get_uid_gid)

Fix the typo in our cgroup_get_uid_gid routine
We seem to have a typo in the function, the fix is quite obvious.

Reported-by: Ciju Rajan K <ciju@linux.vnet.ibm.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoFix the typo in our cgroup_get_uid_gid routine
Balbir Singh [Wed, 24 Mar 2010 07:17:11 +0000 (12:47 +0530)] 
Fix the typo in our cgroup_get_uid_gid routine

Reported-by: Ciju Rajan K <ciju@linux.vnet.ibm.com>
We seem to have a typo in the function, the fix is quite obvious.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoSplit header file III
Jan Safranek [Fri, 12 Mar 2010 15:50:20 +0000 (16:50 +0100)] 
Split header file III

Changelog:
 - since there are no global macros, base.h is gone
 - since there is no base.h, all headers need to include <features.h> to get
   __BEGIN_DECLS
 - new init.h with cgroup_init() and cgroup_get_subsys_mount_point()
 - new error.h with error handling enum and related stuff
 - use #ifndef _LIBCGROUP_*_H instead _LIBCG_*_H in header guards
 - fix few checkpatch complaints (long lines, whitespaces, ...)

The patch includes Makefile and .spec changes. I tested it compiles,
make dist produces tarball with all headers, so does also the rpm.
'make' should automatically catch all changes in new headers and
recompile dependent (=all) sources when any header changes.

libcgroup.h
  - does not declare anything, it just includes all the other files. In
    future, it might contain base of doxygen documentation (some
    introduction etc.)

libcgroup/error.h
  - the big enum with errors + error related functions

libcgroup/init.h
  - libcgroup_init() and cgroup_get_subsys_mount_point()

libcgroup/config.h
  - configuration reading/unloading

libcgroup/groups.h
  - group manipulation stuff (create/modify/delete/free, incl. controllers and
    get/set values) + definition of struct cgroup (=must be included by
    libcgroup/tasks.h, which needs it)

libcgroup/iterators.h
  - various walks, *_begin/next/end

libcgroup/tasks.h
  - task classification, incl. rules cache manipulation

In addition, I probably removed some #includes, which are not needed now when
looking for the minimal #include set to build the project. I also hope I did not
miss any function declaration or macro...

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMove private definitions to private header
Jan Safranek [Fri, 12 Mar 2010 15:50:10 +0000 (16:50 +0100)] 
Move private definitions to private header

Most of the macro definitions in licgroup.h are internal, let's move them
to private header. Applications should not depend on them. The only one
really needed is CG_VALUE_MAX, which is used in struct cgroup_stat.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoAnonymize error enum
Jan Safranek [Fri, 12 Mar 2010 15:50:01 +0000 (16:50 +0100)] 
Anonymize error enum

The enum with ECG* error codes should be anonymous, as pointed out by
Lennart Poettering.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoUse memset to initialize sigaction struct
Jon Bernard [Tue, 9 Mar 2010 21:10:39 +0000 (16:10 -0500)] 
Use memset to initialize sigaction struct

The sa_restorer field is not present on some architectures, like alpha.
By using memset, the structure is initialized appropriately regardless of
struct contents.

Signed-off-by: Jon Bernard <jbernard@debian.org>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agorpm spec file misses the sysconfig/cgconfig file
Chris [Tue, 9 Mar 2010 16:09:48 +0000 (11:09 -0500)] 
rpm spec file misses the sysconfig/cgconfig file

The /etc/sysconfig/cgconfig file is never installed with the current RPM
spec file. This fixes it for me:

Signed-off-by: Chris Tasma <chris@deksai.com>
Reviewed-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoinit script can miss default group
Chris [Tue, 9 Mar 2010 16:04:46 +0000 (11:04 -0500)] 
init script can miss default group

If there is a directive like *:httpd before * in the cgconfig file, all
processes end up being moved into the wrong group on cgconfig startup, and
the default group is never made. This fixes it for me:

Signed-off-by: Chris Tasma <chris@deksai.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoMake the error stings const
Jan Safranek [Mon, 8 Mar 2010 11:46:11 +0000 (12:46 +0100)] 
Make the error stings const

Make the error stings const, just to be safe.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoRemove last_errno from public header
Jan Safranek [Mon, 8 Mar 2010 11:46:04 +0000 (12:46 +0100)] 
Remove last_errno from public header

Remove last_errno from public header, that's why we have cgroup_get_last_errno.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agoRemove GNU_SOURCE from public headers
Jan Safranek [Mon, 8 Mar 2010 11:45:57 +0000 (12:45 +0100)] 
Remove GNU_SOURCE from public headers

Remove GNU_SOURCE from public headers, it has unpredictable consequences on
applications using libcgroup.h

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agolibcgroup: Add a gitignore file
Dhaval Giani [Wed, 17 Feb 2010 16:26:05 +0000 (17:26 +0100)] 
libcgroup: Add a gitignore file

Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
15 years agofix cgroup_get_value_string problem with *.stat output
Ivana Hutarova Varekova [Mon, 8 Feb 2010 12:32:41 +0000 (13:32 +0100)] 
fix cgroup_get_value_string problem with *.stat output

fix cgroup_get_value_string problem with *.stat output
the problem was in the low limit for value for the output of stat variables - now there are used the functions cgroup_read_stats_{begin/next/end} for this purpose

bogus output:
./src/tools/cgget -r memory.stat /
/:
memory.stat=cache 1024561152
rss 291270656
pgpgin 1209259
pgpgout 888011
inactive_anon 8192
active_anon 2976481

fixed output:
$ ./src/tools/cgget -r memory.stat /
/:
memory.stat=cache 1024610304
rss 291270656
pgpgin 1209271
pgpgout 888011
inactive_anon 8192
active_anon 297648128
inactive_file 619126784
active_file 399073280
unevictable 24576
hierarchical_memory_limit 9223372036854775807
hierarchical_memsw_limit 9223372036854775807
total_cache 1024610304
total_rss 291270656
total_pgpgin 1209271
total_pgpgout 888011
total_inactive_anon 8192
total_active_anon 297648128
total_inactive_file 619126784
total_active_file 399073280
total_unevictable 24576

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoThis patch adds to cgget option -a:
Ivana Hutarova Varekova [Mon, 8 Feb 2010 12:32:26 +0000 (13:32 +0100)] 
This patch adds to cgget option -a:

v2:
removed bunch of unnecessary error messages
This patch adds to cgget option -a:
-a     print the variables for all controllers which consists given cgroup

EXAMPLE:
$ ./cgget -a /daemons
/daemons:
cpuset.memory_spread_slab=0
cpuset.memory_spread_page=0
cpuset.memory_pressure=0
cpuset.memory_migrate=0
cpuset.sched_relax_domain_level=-1
cpuset.sched_load_balance=1
cpuset.mem_hardwall=0
cpuset.mem_exclusive=0
cpuset.cpu_exclusive=0
cpuset.mems=
cpuset.cpus=
cpuacct.stat=user 0
system 0
cpuacct.usage_percpu=0 0
cpuacct.usage=0

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoadds new option -g to cgget command
Ivana Hutarova Varekova [Mon, 8 Feb 2010 12:32:18 +0000 (13:32 +0100)] 
adds new option -g to cgget command

adds new option -g to cgget command
* the option has one argument - controller
* cgget -g devices / returns the values of all variables of controller
devices
* the option could be used multiple times

EXAMLES:

$ ./cgget -n -g cpu -r cpuset.mems /
cpu.rt_period_us=1000000
cpu.rt_runtime_us=950000
cpu.shares=1024
cpuset.mems=0

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoThis is the test program for listing controller variables
Ivana Hutarova Varekova [Mon, 8 Feb 2010 12:31:56 +0000 (13:31 +0100)] 
This is the test program for listing controller variables

This is the test program for new internal functions:

    int cgroup_get_value_name_count(struct cgroup_controller *controller)
    char *cgroup_get_value_name(struct cgroup_controller *controller, int     index)

The program display the variables of input controllers.

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoapi for generating the list of variables of given controller
Ivana Hutarova Varekova [Mon, 8 Feb 2010 12:31:47 +0000 (13:31 +0100)] 
api for generating the list of variables of given controller

api for generating the list of variables of given controller:
changelog - v2:
fixed the space on the end of lines

  * int cgroup_get_value_name_count(struct cgroup_controller,  *controller)
  functions return the number of variables in "controller"

  * char *cgroup_get_value_name(struct cgroup_controller *controller, int index)
  function return the "index" variable of "controller"

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years agoRelease procedure proposal
Jan Safranek [Mon, 8 Feb 2010 13:13:18 +0000 (14:13 +0100)] 
Release procedure proposal

this is my proposal for release procedure - it's quite simple and covers all
the technical details you need to know regarding autotools.

Changelog:
- re-diff with current master (and not my internal branch :)
- renumber the steps

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
15 years ago[PATCH-v2] Add the write error handling to cg_set_control_value().
Ken'ichi Ohmichi [Thu, 28 Jan 2010 05:45:48 +0000 (11:15 +0530)] 
[PATCH-v2] Add the write error handling to cg_set_control_value().

Changelog since v1:
 o Use fopen/fprintf/fclose instead of open/write/close.
 o Add the error handling against fclose.

cg_set_control_value() is the function for setting a value to a file
of cgroup file system. And current function does not handle the error
of writing to a file. So we cannot know whether setting value is
enable or not. This patch add the error handling for knowing it.

Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>