Skip to content

Commit

Permalink
cr: set a freezer cgroup for criu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
avagin committed Mar 22, 2017
1 parent ea51324 commit 89b73a7
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 @@ -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{
Expand Down

0 comments on commit 89b73a7

Please sign in to comment.