Skip to content

Commit 5446518

Browse files
committed
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 <[email protected]>
1 parent d7be704 commit 5446518

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libcontainer/container_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,11 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
694694
OrphanPtsMaster: proto.Bool(true),
695695
}
696696

697+
fcg := c.cgroupManager.GetPaths()["freezer"]
698+
if fcg != "" {
699+
rpcOpts.FreezeCgroup = proto.String(fcg)
700+
}
701+
697702
// append optional criu opts, e.g., page-server and port
698703
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
699704
rpcOpts.Ps = &criurpc.CriuPageServerInfo{

0 commit comments

Comments
 (0)