summaryrefslogtreecommitdiff
path: root/pkg/criu/criu.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-23 07:53:11 -0700
committerGitHub <noreply@github.com>2018-10-23 07:53:11 -0700
commit2e6bc3c7af261228ae7a75cb5749062928fa24b3 (patch)
tree94b3af23e8f5d774be0e4846698fac685a5f56f3 /pkg/criu/criu.go
parent79befd5158c8f01a88e4d14e46851ddcc11d51c4 (diff)
parenta14155917baa577bebbbc0c5983a7a90bf35c2b5 (diff)
downloadpodman-2e6bc3c7af261228ae7a75cb5749062928fa24b3.tar.gz
podman-2e6bc3c7af261228ae7a75cb5749062928fa24b3.tar.bz2
podman-2e6bc3c7af261228ae7a75cb5749062928fa24b3.zip
Merge pull request #1627 from adrianreber/criu
Add CRIU version check for checkpoint and restore
Diffstat (limited to 'pkg/criu/criu.go')
-rw-r--r--pkg/criu/criu.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/criu/criu.go b/pkg/criu/criu.go
new file mode 100644
index 000000000..f4cce238a
--- /dev/null
+++ b/pkg/criu/criu.go
@@ -0,0 +1,19 @@
+package criu
+
+import (
+ "github.com/checkpoint-restore/go-criu"
+)
+
+// MinCriuVersion for Podman at least CRIU 3.11 is required
+const MinCriuVersion = 31100
+
+// CheckForCriu uses CRIU's go bindings to check if the CRIU
+// binary exists and if it at least the version Podman needs.
+func CheckForCriu() bool {
+ c := criu.MakeCriu()
+ result, err := c.IsCriuAtLeast(MinCriuVersion)
+ if err != nil {
+ return false
+ }
+ return result
+}