checkpoint/restore commands support 'file-locks' option.

Signed-off-by: mapk0y <mapk0y@gmail.com>
This commit is contained in:
mapk0y 2015-06-27 18:56:24 +09:00
parent 3fec3b37bf
commit 986dc0f730
4 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@ var checkpointCommand = cli.Command{
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
cli.BoolFlag{Name: "shell-job", Usage: "allow shell jobs"},
cli.StringFlag{Name: "page-server", Value: "", Usage: "ADDRESS:PORT of the page server"},
cli.BoolFlag{Name: "file-locks", Usage: "handle file locks, for safety"},
},
Action: func(context *cli.Context) {
container, err := getContainer(context)

View File

@ -344,6 +344,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
LeaveRunning: proto.Bool(criuOpts.LeaveRunning),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
FileLocks: proto.Bool(criuOpts.FileLocks),
}
// append optional criu opts, e.g., page-server and port
@ -463,6 +464,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
ShellJob: proto.Bool(criuOpts.ShellJob),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
FileLocks: proto.Bool(criuOpts.FileLocks),
},
}
for _, m := range c.config.Mounts {

View File

@ -12,5 +12,6 @@ type CriuOpts struct {
TcpEstablished bool // checkpoint/restore established TCP connections
ExternalUnixConnections bool // allow external unix connections
ShellJob bool // allow to dump and restore shell jobs
FileLocks bool // handle file locks, for safety
PageServer CriuPageServerInfo // allow to dump to criu page server
}

View File

@ -21,6 +21,7 @@ var restoreCommand = cli.Command{
cli.BoolFlag{Name: "tcp-established", Usage: "allow open tcp connections"},
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
cli.BoolFlag{Name: "shell-job", Usage: "allow shell jobs"},
cli.BoolFlag{Name: "file-locks", Usage: "handle file locks, for safety"},
},
Action: func(context *cli.Context) {
imagePath := context.String("image-path")
@ -109,6 +110,7 @@ func criuOptions(context *cli.Context) *libcontainer.CriuOpts {
TcpEstablished: true, // context.Bool("tcp-established"),
ExternalUnixConnections: context.Bool("ext-unix-sk"),
ShellJob: context.Bool("shell-job"),
FileLocks: context.Bool("file-locks"),
}
}