github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/criu/criu.go (about)

     1  package criu
     2  
     3  import (
     4  	"github.com/checkpoint-restore/go-criu"
     5  )
     6  
     7  // MinCriuVersion for Podman at least CRIU 3.11 is required
     8  const MinCriuVersion = 31100
     9  
    10  // CheckForCriu uses CRIU's go bindings to check if the CRIU
    11  // binary exists and if it at least the version Podman needs.
    12  func CheckForCriu() bool {
    13  	c := criu.MakeCriu()
    14  	result, err := c.IsCriuAtLeast(MinCriuVersion)
    15  	if err != nil {
    16  		return false
    17  	}
    18  	return result
    19  }