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> Acked-by: Jan Safranek<jsafr...@redhat.com> --- src/api.c | 8 ++------ 1 files changed, 2 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 f889787..9417e8b 100644 --- a/src/api.c +++ b/src/api.c @@ -2792,14 +2792,10 @@ static int cgroup_create_template_group(char *orig_group_name, /* 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) { ------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel