| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch handles the validation of the newer configuration files.
Some of the rules to be followed
1. We cannot have more controllers in the namespcae section than
already mounted.
2. If more than one controller are mounted at the same point, then
they will have the same namespace. In case it is not explicitly
mentioned, the subsystems at the mount point will be set to the
same namespace. This does not mean that controllers mounted at different
points need to have the same namespace.
Changes from v4:
1. Changed a variable name from mount to mount_path
2. Added more comments
Changes from v3:
1. Removed most of the strdups
2. Fixed return values for errors
Changes from v2:
1. mount and namespace keyword cannot come in the same file.
Changes from v1:
1. Fix a bug where if a namespace was not defined, we were not exiting
2. Comment the validate namespace function
3. Make some of the variables more descriptive
4. Make namespace thread specific
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces a new keywork NAMESPACE which allow cgroups
to be created starting from a certain point as mentioned by the
administrator. This is provided via the configuration file.
Newer APIs will use this feature.
Changes from v1:
1. Attempted to fix the indentation
2. Change a variable name
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
move copy_name_value_from_rules procedure to wrapper.c file and
add the header to libcgroup-internal.h
Signed-off-by: Ivana Varekova <varekova@redhat.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
Changelog of v6:
================
* The definations of CGROUP_RULE_MAXKEY and CGROUP_RULE_MAXLINE are
moved to libcgroup-internal.h since no one from outside should be
using them.
Changelog of v5:
================
* Rebase the patch to the latest code.
Changelog of v4:
================
* Use more safety length of a user name for the buffer "username".
* Move the macros min()/max() to src/libcgroup-internal.h for using
in src/api.c also.
Changelog of v3:
================
* Fix unclear buffer of user by memset().
Changelog of v2:
================
* Remove unnecessary memset().
* Some cleanups.
Description:
============
This patch adds the parser of process name in /etc/cgrules.conf.
A new rule based on process name is as the following, and the process
name is stored into the member "procname" in struct cgroup_rule.
<user>:<process name> <controllers> <destination>
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
Changelog of v6:
================
* Change the returning values of *_get_procname_from_proc*() to integer
from charactor pointer.
* Clarify the number meaning of string length in cg_get_procname_from_
~proc_status()
Changelog of v5:
================
* Rebase the patch to the latest code.
Changelog of v4:
================
* Add the error handling for strdup()'s error.
* Reduce strlen() calls.
* Make the check code of a process name simple.
Changelog of v3:
================
* Move cgroup_get_procname_from_procfs() to libcgroup-internal.h.
* Fix unclear buffer of buf_cwd by memset().
* Get a real path of script file by realpath().
Changelog of v2:
================
* It is possible to handle a process, which name length is over than
16 characters, also.
Description:
============
This patch adds a new function cgroup_get_procname_from_procfs()
for getting a process name.
This function allocates the memory for a process name, and writes
the name to the memory, and returns the pointer of the memory.
So a caller should free the memory if unusing it.
The process name, which is wrotten by this function, depends on
the specified process:
If a command process) the full path of command.
If a shell script process) the full path of shell script.
If a kernel thread) the process name of kernel thread.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a cgroup_tree_handle structure so that we can track flags for
the walk_tree operation. In a number of cases we would prefer to walk the
tree in postorder as opposed to pre-order which is the current default.
This patch does the addition.
Changes since V1:
1. Added checks for !handle as suggested by Bharata
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.redhat.com/show_bug.cgi?id=502687 mentioned that the directory
was not getting created when a cgconfig start was being run.
This is was because we failed the mkdir. The mkdir for directories at depth
was not succeeding.
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CHANGELOG of v2.1:
================
* Rebase the patch for commit '340feae163c4797a6cb1247b3812c1ccdc52fa41'.
There are some similar functions for getting process's data (uid, gid) from
/proc/<pid>/status file, so this patch integrates these functions into one
cgroup_get_uid_gid_from_procfs().
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi,
CHANGELOG of v2:
================
* No change.
To add the member "procname" to struct cgroup_rule by later patch, this
patch renames the member "name" to "username" for the clarification.
Thanks
Ken'ichi Ohmichi
Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
|
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
|