diff options
author | Adrian Reber <areber@redhat.com> | 2021-02-25 15:34:12 +0000 |
---|---|---|
committer | Adrian Reber <areber@redhat.com> | 2021-03-02 17:00:06 +0000 |
commit | bf92e21113c9b2d2ff4c18423ff3deb10a1ce29e (patch) | |
tree | 8a78b0a8b9b28bc6dcbcbe6e7a4cba537630305d /libpod/oci_conmon_linux.go | |
parent | bd819ef7dc46ffdcc79e67eb384752d5b2ec5291 (diff) | |
download | podman-bf92e21113c9b2d2ff4c18423ff3deb10a1ce29e.tar.gz podman-bf92e21113c9b2d2ff4c18423ff3deb10a1ce29e.tar.bz2 podman-bf92e21113c9b2d2ff4c18423ff3deb10a1ce29e.zip |
Move checkpoint/restore code to pkg/checkpoint/crutils
To be able to reuse common checkpoint/restore functions this commit
moves code to pkg/checkpoint/crutils.
This commit has not functional changes. It only moves code around.
[NO TESTS NEEDED] - only moving code around
Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r-- | libpod/oci_conmon_linux.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index de7630c06..492bc807a 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -28,6 +28,7 @@ import ( "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/logs" "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/podman/v3/pkg/checkpoint/crutils" "github.com/containers/podman/v3/pkg/errorhandling" "github.com/containers/podman/v3/pkg/lookup" "github.com/containers/podman/v3/pkg/rootless" @@ -837,16 +838,7 @@ func (r *ConmonOCIRuntime) CheckConmonRunning(ctr *Container) (bool, error) { // SupportsCheckpoint checks if the OCI runtime supports checkpointing // containers. func (r *ConmonOCIRuntime) SupportsCheckpoint() bool { - // Check if the runtime implements checkpointing. Currently only - // runc's checkpoint/restore implementation is supported. - cmd := exec.Command(r.path, "checkpoint", "--help") - if err := cmd.Start(); err != nil { - return false - } - if err := cmd.Wait(); err == nil { - return true - } - return false + return crutils.CRRuntimeSupportsCheckpointRestore(r.path) } // SupportsJSONErrors checks if the OCI runtime supports JSON-formatted error |