On 07/18/2013 07:53 PM, Ivana Hutarova Varekova wrote:
> create_cgroup_from_name_value_pairs can't deal name/value pairs from the same 
> controller
> E.G.
> cgset -r cpu.cfs_quota_us=400000 -r cpu.cfs_period_us=400000 cgroup
> This patch fix the problem.
> 
> Signed-off-by: Ivana Hutarova Varekova <varek...@redhat.com>

Acked-By: Jan Safranek <jsafr...@redhat.com>

> ---
> 
>  src/wrapper.c |   15 ++++++++++-----
>  1 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/src/wrapper.c b/src/wrapper.c
> index dfcfc8f..c03472a 100644
> --- a/src/wrapper.c
> +++ b/src/wrapper.c
> @@ -556,12 +556,17 @@ struct cgroup 
> *create_cgroup_from_name_value_pairs(const char *name,
>               strncpy(con, name_value[i].name, FILENAME_MAX);
>               strtok(con, ".");
>  
> -             /* add relevant controller */
> -             cgc = cgroup_add_controller(src_cgroup, con);
> +             /* find out whether we have to add the controller or
> +                cgroup already contains it */
> +             cgc = cgroup_get_controller(src_cgroup, con);
>               if (!cgc) {
> -                     fprintf(stderr, "controller %s can't be add\n",
> -                                     con);
> -                     goto scgroup_err;
> +                     /* add relevant controller */
> +                     cgc = cgroup_add_controller(src_cgroup, con);
> +                     if (!cgc) {
> +                             fprintf(stderr, "controller %s can't be add\n",
> +                                             con);
> +                             goto scgroup_err;
> +                     }
>               }
>  
>               /* add name-value pair to this controller */
> 
> 
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Libcg-devel mailing list
> Libcg-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
> 


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to