mirror of
https://github.com/containers/podman.git
synced 2025-06-29 23:22:40 +08:00
Merge pull request #5707 from adrianreber/crun-checkpoint-1
Prepare for crun checkpoint support
This commit is contained in:
@ -933,6 +933,13 @@ func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options Container
|
|||||||
if options.TCPEstablished {
|
if options.TCPEstablished {
|
||||||
args = append(args, "--tcp-established")
|
args = append(args, "--tcp-established")
|
||||||
}
|
}
|
||||||
|
runtimeDir, err := util.GetRuntimeDir()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err = os.Setenv("XDG_RUNTIME_DIR", runtimeDir); err != nil {
|
||||||
|
return errors.Wrapf(err, "cannot set XDG_RUNTIME_DIR")
|
||||||
|
}
|
||||||
args = append(args, ctr.ID())
|
args = append(args, ctr.ID())
|
||||||
return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, nil, r.path, args...)
|
return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, nil, r.path, args...)
|
||||||
}
|
}
|
||||||
@ -942,7 +949,7 @@ func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options Container
|
|||||||
func (r *ConmonOCIRuntime) SupportsCheckpoint() bool {
|
func (r *ConmonOCIRuntime) SupportsCheckpoint() bool {
|
||||||
// Check if the runtime implements checkpointing. Currently only
|
// Check if the runtime implements checkpointing. Currently only
|
||||||
// runc's checkpoint/restore implementation is supported.
|
// runc's checkpoint/restore implementation is supported.
|
||||||
cmd := exec.Command(r.path, "checkpoint", "-h")
|
cmd := exec.Command(r.path, "checkpoint", "--help")
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ var _ = Describe("Podman checkpoint", func() {
|
|||||||
podmanTest.SeedImages()
|
podmanTest.SeedImages()
|
||||||
// Check if the runtime implements checkpointing. Currently only
|
// Check if the runtime implements checkpointing. Currently only
|
||||||
// runc's checkpoint/restore implementation is supported.
|
// runc's checkpoint/restore implementation is supported.
|
||||||
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "-h")
|
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
Skip("OCI runtime does not support checkpoint/restore")
|
Skip("OCI runtime does not support checkpoint/restore")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user