From d5c57dcea6d8b19c0f87fc0a212d3020215af06e Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 15 May 2020 12:22:27 -0700 Subject: [PATCH] libct/criuApplyCgroups: don't set cgroup paths for v2 There is no need to have cgroupv1-specific controller paths on restore in case of cgroupv2. Signed-off-by: Kir Kolyshkin --- libcontainer/container_linux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index ca1d439d6f7..e958d15985e 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -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 {