Skip to content

Commit 8c72dfa

Browse files
authored
Merge pull request #4627 from beam-cloud/main
Add skip-in-flight and link-remap criu options for checkpoint and restore
2 parents 352c8d4 + 1d047e4 commit 8c72dfa

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

checkpoint.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ checkpointed.`,
3131
cli.StringFlag{Name: "parent-path", Value: "", Usage: "path for previous criu image files in pre-dump"},
3232
cli.BoolFlag{Name: "leave-running", Usage: "leave the process running after checkpointing"},
3333
cli.BoolFlag{Name: "tcp-established", Usage: "allow open tcp connections"},
34+
cli.BoolFlag{Name: "tcp-skip-in-flight", Usage: "skip in-flight tcp connections"},
35+
cli.BoolFlag{Name: "link-remap", Usage: "allow one to link unlinked files back when possible"},
3436
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
3537
cli.BoolFlag{Name: "shell-job", Usage: "allow shell jobs"},
3638
cli.BoolFlag{Name: "lazy-pages", Usage: "use userfaultfd to lazily restore memory pages"},
@@ -122,6 +124,8 @@ func criuOptions(context *cli.Context) (*libcontainer.CriuOpts, error) {
122124
ParentImage: parentPath,
123125
LeaveRunning: context.Bool("leave-running"),
124126
TcpEstablished: context.Bool("tcp-established"),
127+
TcpSkipInFlight: context.Bool("tcp-skip-in-flight"),
128+
LinkRemap: context.Bool("link-remap"),
125129
ExternalUnixConnections: context.Bool("ext-unix-sk"),
126130
ShellJob: context.Bool("shell-job"),
127131
FileLocks: context.Bool("file-locks"),

contrib/completions/bash/runc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ _runc_checkpoint() {
507507
-h
508508
--leave-running
509509
--tcp-established
510+
--tcp-skip-in-flight
511+
--link-remap
510512
--ext-unix-sk
511513
--shell-job
512514
--lazy-pages

libcontainer/criu_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
327327
ShellJob: proto.Bool(criuOpts.ShellJob),
328328
LeaveRunning: proto.Bool(criuOpts.LeaveRunning),
329329
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
330+
TcpSkipInFlight: proto.Bool(criuOpts.TcpSkipInFlight),
331+
LinkRemap: proto.Bool(criuOpts.LinkRemap),
330332
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
331333
FileLocks: proto.Bool(criuOpts.FileLocks),
332334
EmptyNs: proto.Uint32(criuOpts.EmptyNs),

libcontainer/criu_opts_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type CriuOpts struct {
1616
ParentImage string // directory for storing parent image files in pre-dump and dump
1717
LeaveRunning bool // leave container in running state after checkpoint
1818
TcpEstablished bool // checkpoint/restore established TCP connections
19+
TcpSkipInFlight bool // skip in-flight TCP connections
20+
LinkRemap bool // allow one to link unlinked files back when possible
1921
ExternalUnixConnections bool // allow external unix connections
2022
ShellJob bool // allow to dump and restore shell jobs
2123
FileLocks bool // handle file locks, for safety

man/runc-checkpoint.8.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ image files directory.
2828
: Allow checkpoint/restore of established TCP connections. See
2929
[criu --tcp-establised option](https://criu.org/CLI/opt/--tcp-established).
3030

31+
**--tcp-skip-in-flight**
32+
: Skip in-flight TCP connections. See
33+
[criu --skip-in-flight option](https://criu.org/CLI/opt/--skip-in-flight).
34+
35+
**--link-remap**
36+
: Allow one to link unlinked files back when possible. See
37+
[criu --link-remap option](https://criu.org/CLI/opt/--link-remap).
38+
3139
**--ext-unix-sk**
3240
: Allow checkpoint/restore of external unix sockets. See
3341
[criu --ext-unix-sk option](https://criu.org/CLI/opt/--ext-unix-sk).

0 commit comments

Comments
 (0)