cgroup_change_cgroup_flags: use cgroup_config_create_template_group instead of cgroup_create_cgroup -> this function reads configure file, if it is not already cached and use template setting from if the template is used in rule and the group does not exist yet.
Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com> --- include/libcgroup/tasks.h | 2 ++ src/api.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h index 7e5089c..0f79220 100644 --- a/include/libcgroup/tasks.h +++ b/include/libcgroup/tasks.h @@ -128,6 +128,8 @@ void cgroup_print_rules_config(FILE *fp); * * The flags can alter the behavior of this function: * CGFLAG_USECACHE: Use cached rules instead of parsing the config file + * CGFLAG_USE_TEMPLATE_CACHE: Use cached templates instead of + * parsing the config file * * This function may NOT be thread safe. * @param uid The UID to match. diff --git a/src/api.c b/src/api.c index 9cae6a0..8966a21 100644 --- a/src/api.c +++ b/src/api.c @@ -2772,14 +2772,10 @@ int cgroup_create_template_group(char *orig_group_name, struct cgroup_rule *tmp, /* the prefix cgroup without template */ ret = cgroup_create_cgroup(template_group, 0); } else { - /* TODO: this will be a function which use - * template to create relevant cgroup - * now cgroup_create_cgroup is used + /* use template to create relevant cgroup */ ret = cgroup_config_create_template_group( template_group, template_name, - 0, flags); - */ - ret = cgroup_create_cgroup(template_group, 0); + flags); } if (ret != 0) { ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel