diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-12 07:57:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 07:57:05 -0500 |
commit | 5575c7be2023d0709432b12b60124168c6956c8a (patch) | |
tree | 3856aabbe4003f23663978d3f01062a091d80c1c /libpod/container_internal.go | |
parent | 1955eee89f083ec814a44025dc0abe59748205b3 (diff) | |
parent | 2aa381f2d0cdc8abb28aa8759c681198cb1e47a7 (diff) | |
download | podman-5575c7be2023d0709432b12b60124168c6956c8a.tar.gz podman-5575c7be2023d0709432b12b60124168c6956c8a.tar.bz2 podman-5575c7be2023d0709432b12b60124168c6956c8a.zip |
Merge pull request #8819 from chen-zhuohan/add-pre-checkpoint
Add pre-checkpoint and restore with previous
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 540230c26..c7548e0e5 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -134,6 +134,11 @@ func (c *Container) CheckpointPath() string { return filepath.Join(c.bundlePath(), "checkpoint") } +// PreCheckpointPath returns the path to the directory containing the pre-checkpoint-images +func (c *Container) PreCheckPointPath() string { + return filepath.Join(c.bundlePath(), "pre-checkpoint") +} + // AttachSocketPath retrieves the path of the container's attach socket func (c *Container) AttachSocketPath() (string, error) { return c.ociRuntime.AttachSocketPath(c) @@ -2023,6 +2028,12 @@ func (c *Container) checkReadyForRemoval() error { return nil } +// canWithPrevious return the stat of the preCheckPoint dir +func (c *Container) canWithPrevious() error { + _, err := os.Stat(c.PreCheckPointPath()) + return err +} + // writeJSONFile marshalls and writes the given data to a JSON file // in the bundle path func (c *Container) writeJSONFile(v interface{}, file string) error { |