Skip to content

Commit

Permalink
libct/criuApplyCgroups: don't set cgroup paths for v2
Browse files Browse the repository at this point in the history
There is no need to have cgroupv1-specific controller paths on restore
in case of cgroupv2.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Jun 16, 2020
1 parent 52b56bc commit d5c57dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,11 @@ func (c *linuxContainer) criuApplyCgroups(pid int, req *criurpc.CriuReq) error {
return newSystemError(err)
}

if cgroups.IsCgroup2UnifiedMode() {
return nil
}
// the stuff below is cgroupv1-specific

path := fmt.Sprintf("/proc/%d/cgroup", pid)
cgroupsPaths, err := cgroups.ParseCgroupFile(path)
if err != nil {
Expand Down

0 comments on commit d5c57dc

Please sign in to comment.