Merge pull request #2259 from adrianreber/v2-test

Add minimal cgroup2 checkpoint/restore support
This commit is contained in:
Michael Crosby
2020-03-31 15:01:18 -04:00
committed by GitHub
4 changed files with 31 additions and 14 deletions

View File

@@ -1015,9 +1015,14 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
}
}
fcg := c.cgroupManager.GetPaths()["freezer"]
if fcg != "" {
rpcOpts.FreezeCgroup = proto.String(fcg)
if !cgroups.IsCgroup2UnifiedMode() && c.checkCriuVersion(31400) == nil {
// CRIU currently cannot handle the v2 freezer correctly
// before release 3.14. For older releases we are telling
// CRIU to not use the cgroup v2 freezer. CRIU will pause
// each process manually using ptrace().
if fcg := c.cgroupManager.GetPaths()["freezer"]; fcg != "" {
rpcOpts.FreezeCgroup = proto.String(fcg)
}
}
// append optional criu opts, e.g., page-server and port