aboutsummaryrefslogtreecommitdiff
path: root/pkg/criu/criu.go
blob: f4cce238afc0e211310ad5e9526e74a54782fb24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
}