From 7b92e178267794e026f5c38e632d82a00f038e96 Mon Sep 17 00:00:00 2001
From: Andrei Vagin <avagin@virtuozzo.com>
Date: Fri, 7 Apr 2017 02:34:41 +0300
Subject: [PATCH 17/94] restore: apply resource limits

When C/R was implemented, it was enough to call manager.Set to apply
limits and to move a task. Now .Set() and .Apply() have to be called
separately.

Change-Id: I4786732a1779a65eeb902fc1ef42b194ba8dd3b4
Fixes: 8a740d5391a7 ("libcontainer: cgroups: don't Set in Apply")
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 libcontainer/container_linux.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go
index 705472a..b5563d6 100644
--- a/libcontainer/container_linux.go
+++ b/libcontainer/container_linux.go
@@ -1008,6 +1008,10 @@ func (c *linuxContainer) criuApplyCgroups(pid int, req *criurpc.CriuReq) error {
 		return err
 	}
 
+	if err := c.cgroupManager.Set(c.config); err != nil {
+		return newSystemError(err)
+	}
+
 	path := fmt.Sprintf("/proc/%d/cgroup", pid)
 	cgroupsPaths, err := cgroups.ParseCgroupFile(path)
 	if err != nil {
-- 
2.7.4.3

