Skip to content

Commit

Permalink
Skip root cgroup directories when restoring with manage-cgroup=full
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <[email protected]>
Signed-off-by: Andrew Vagin <[email protected]>
Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
huikang authored and xemul committed Sep 2, 2015
1 parent 911bb68 commit 19dbe25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit 19dbe25

Please sign in to comment.