diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-28 07:00:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 07:00:24 -0800 |
commit | effd63d6d5c2541f09745261a1e9205fa531e526 (patch) | |
tree | 2f7a3f956fdc1dfcb0743da87fbec4abb02662a6 /libpod/oci.go | |
parent | d346996e1512ef6efb3800d6cb762d0409d12459 (diff) | |
parent | d3cde7cefe4eed4b8cb0723211c19352c55f3dcf (diff) | |
download | podman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.gz podman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.bz2 podman-effd63d6d5c2541f09745261a1e9205fa531e526.zip |
Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
Diffstat (limited to 'libpod/oci.go')
-rw-r--r-- | libpod/oci.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 4460402ed..a8013aa47 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -227,7 +227,7 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) { return files, nil } -func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, restoreContainer bool) (err error) { +func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, restoreOptions *ContainerCheckpointOptions) (err error) { var stderrBuf bytes.Buffer runtimeDir, err := util.GetRootlessRuntimeDir() @@ -289,8 +289,11 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res args = append(args, "--syslog") } - if restoreContainer { + if restoreOptions != nil { args = append(args, "--restore", ctr.CheckpointPath()) + if restoreOptions.TCPEstablished { + args = append(args, "--restore-arg", "--tcp-established") + } } logrus.WithFields(logrus.Fields{ @@ -866,6 +869,9 @@ func (r *OCIRuntime) checkpointContainer(ctr *Container, options ContainerCheckp if options.KeepRunning { args = append(args, "--leave-running") } + if options.TCPEstablished { + args = append(args, "--tcp-established") + } args = append(args, ctr.ID()) return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, nil, r.path, args...) } |