criu_opts_linux.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package libcontainer
  2. // cgroup restoring strategy provided by criu
  3. type cgMode uint32
  4. const (
  5. CRIU_CG_MODE_SOFT cgMode = 3 + iota // restore cgroup properties if only dir created by criu
  6. CRIU_CG_MODE_FULL // always restore all cgroups and their properties
  7. CRIU_CG_MODE_STRICT // restore all, requiring them to not present in the system
  8. CRIU_CG_MODE_DEFAULT // the same as CRIU_CG_MODE_SOFT
  9. )
  10. type CriuPageServerInfo struct {
  11. Address string // IP address of CRIU page server
  12. Port int32 // port number of CRIU page server
  13. }
  14. type VethPairName struct {
  15. ContainerInterfaceName string
  16. HostInterfaceName string
  17. }
  18. type CriuOpts struct {
  19. ImagesDirectory string // directory for storing image files
  20. WorkDirectory string // directory to cd and write logs/pidfiles/stats to
  21. ParentImage string // directory for storing parent image files in pre-dump and dump
  22. LeaveRunning bool // leave container in running state after checkpoint
  23. TcpEstablished bool // checkpoint/restore established TCP connections
  24. ExternalUnixConnections bool // allow external unix connections
  25. ShellJob bool // allow to dump and restore shell jobs
  26. FileLocks bool // handle file locks, for safety
  27. PreDump bool // call criu predump to perform iterative checkpoint
  28. PageServer CriuPageServerInfo // allow to dump to criu page server
  29. VethPairs []VethPairName // pass the veth to criu when restore
  30. ManageCgroupsMode cgMode // dump or restore cgroup mode
  31. EmptyNs uint32 // don't c/r properties for namespace from this mask
  32. AutoDedup bool // auto deduplication for incremental dumps
  33. LazyPages bool // restore memory pages lazily using userfaultfd
  34. StatusFd string // fd for feedback when lazy server is ready
  35. }