[CRIU] [PATCH] Skip root cgroup directories when restoring with manage-cgroup=full
Hui Kang
hkang.sunysb at gmail.com
Sat Aug 29 20:36:03 PDT 2015
Signed-off-by: Hui Kang <hkang.sunysb at gmail.com>
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
cgroup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cgroup.c b/cgroup.c
index a4e0146..c0392a1 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -992,6 +992,9 @@ 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 &&
+ goto skip; /* skip root cgroups */
+
off2 += sprintf(path + off, "/%s", e->dir_name);
if (e->n_properties > 0) {
for (j = 0; j < e->n_properties; ++j) {
@@ -1000,6 +1003,7 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
}
}
+skip:
if (prepare_cgroup_dir_properties(path, off2, e->children, e->n_children) < 0)
return -1;
}
--
1.8.3.1
More information about the CRIU
mailing list