From 89b73a732c62847846aad48fcd061e20987d0a57 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 23 Mar 2017 00:41:12 +0300 Subject: [PATCH] cr: set a freezer cgroup for criu A freezer cgroup allows to dump processes faster. If a user wants to checkpoint a container and its storage, he has to pause a container, but in this case we need to pass a path to its freezer cgroup to "criu dump". Signed-off-by: Andrei Vagin --- libcontainer/container_linux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index ef713197a70..9ef5efaf419 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -675,6 +675,11 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error { OrphanPtsMaster: proto.Bool(true), } + fcg := c.cgroupManager.GetPaths()["freezer"] + if fcg != "" { + rpcOpts.FreezeCgroup = proto.String(fcg) + } + // append optional criu opts, e.g., page-server and port if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 { rpcOpts.Ps = &criurpc.CriuPageServerInfo{