[CRIU] [PATCH] cgroup: Skip unified hier controllers

Andrei Vagin avagin at virtuozzo.com
Tue Jun 27 21:49:38 MSK 2017


On Fri, Jun 23, 2017 at 02:13:12PM +0300, Pavel Emelyanov wrote:
> The unified hierarchy controller doesn't have any name, so criu hangs
> while parsing this sort of strings.
> 
> Let's skip those for now, until we implement cgroup2 support.
> 
> https://github.com/xemul/criu/issues/252
> 
> Reported-and-tested-by: Adrian Reber <adrian at lisas.de>
> Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
> 
> ---
> 
> diff --git a/criu/proc_parse.c b/criu/proc_parse.c
> index f1237cf9..708f41c6 100644
> --- a/criu/proc_parse.c
> +++ b/criu/proc_parse.c
> @@ -2272,8 +2272,13 @@ int parse_cgroup_file(FILE *f, struct list_head *retl, unsigned int *n)
>  		 * 2:name=systemd:/user.slice/user-1000.slice/session-1.scope
>  		 */
>  		name = strchr(buf, ':');
> -		if (name)
> +		if (name) {
>  			path = strchr(++name, ':');
> +			if (*name == ':') { /* unified hier */

Could you write a comment here, why we skip them?

> +				xfree(ncc);
> +				continue;
> +			}
> +		}
>  		if (!name || !path) {
>  			pr_err("Failed parsing cgroup %s\n", buf);
>  			xfree(ncc);
> @@ -2437,6 +2442,9 @@ int collect_controllers(struct list_head *cgroups, unsigned int *n_cgroups)
>  		}
>  		controllers++;
>  
> +		if (*controllers == ':') /* unified hier */
> +			continue;
> +
>  		off = strchr(controllers, ':');
>  		if (!off) {
>  			pr_err("Unable to parse \"%s\"\n", buf);
> 
> 
> -- Pavel
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list