summaryrefslogtreecommitdiff
path: root/libpod/oci.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-21 05:11:12 -0800
committerGitHub <noreply@github.com>2018-11-21 05:11:12 -0800
commit1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8 (patch)
treeaadb41e32b4d66420b50a6b7b2dc62b404d03afb /libpod/oci.go
parent23feb0d6f9a6a43e44f959c99100ae24d6c27f6d (diff)
parent24c0739453b3f103a1b548c1bb611013b488afbe (diff)
downloadpodman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.tar.gz
podman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.tar.bz2
podman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.zip
Merge pull request #1835 from adrianreber/master
Added option to keep container running after checkpointing
Diffstat (limited to 'libpod/oci.go')
-rw-r--r--libpod/oci.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index 71da830b5..8ee2c948f 100644
--- a/libpod/oci.go
+++ b/libpod/oci.go
@@ -844,13 +844,22 @@ func (r *OCIRuntime) execStopContainer(ctr *Container, timeout uint) error {
}
// checkpointContainer checkpoints the given container
-func (r *OCIRuntime) checkpointContainer(ctr *Container) error {
+func (r *OCIRuntime) checkpointContainer(ctr *Container, options ContainerCheckpointOptions) error {
// imagePath is used by CRIU to store the actual checkpoint files
imagePath := ctr.CheckpointPath()
// workPath will be used to store dump.log and stats-dump
workPath := ctr.bundlePath()
logrus.Debugf("Writing checkpoint to %s", imagePath)
logrus.Debugf("Writing checkpoint logs to %s", workPath)
- return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, nil, r.path, "checkpoint",
- "--image-path", imagePath, "--work-path", workPath, ctr.ID())
+ args := []string{}
+ args = append(args, "checkpoint")
+ args = append(args, "--image-path")
+ args = append(args, imagePath)
+ args = append(args, "--work-path")
+ args = append(args, workPath)
+ if options.KeepRunning {
+ args = append(args, "--leave-running")
+ }
+ args = append(args, ctr.ID())
+ return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, nil, r.path, args...)
}