[CRIU] [PATCH] Skip restoring certain cgroup root directories when using full mode

Pavel Emelyanov xemul at parallels.com
Sun Aug 16 18:20:37 PDT 2015


On 08/13/2015 07:41 PM, Hui Kang wrote:
> Skip these top cgroup directories: cpu, cpuset, cpuacct, memory
> 
> Signed-off-by: Hui Kang <hkang.sunysb at gmail.com>
> ---
>  cgroup.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/cgroup.c b/cgroup.c
> index a4e0146..94749b1 100644
> --- a/cgroup.c
> +++ b/cgroup.c
> @@ -992,6 +992,10 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
>  		CgroupDirEntry *e = ents[i];
>  		size_t off2 = off;
>  
> +		if (strcmp(e->dir_name, "") == 0 &&
> +		    ((strstr(path, "cpu")) || (strstr(path, "memory"))))
> +			continue;
> +

With this "continue" won't we skip all the properties restore? The e-s we
have here represent all the tree, starting from root and descending. If you
skip the root one, then the whole subtree is skipped too.

Also, how about the restore_special_cpuset_props?

>  		off2 += sprintf(path + off, "/%s", e->dir_name);
>  		if (e->n_properties > 0) {
>  			for (j = 0; j < e->n_properties; ++j) {
> 



More information about the CRIU mailing list