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 178c19e..1bb170e 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2770,14 +2770,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) {


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to