MCPcopy
hub / github.com/opencontainers/runc / checkCriuVersion

Method checkCriuVersion

libcontainer/criu_linux.go:93–108  ·  view source on GitHub ↗

checkCriuVersion checks CRIU version greater than or equal to minVersion.

(minVersion int)

Source from the content-addressed store, hash-verified

91
92// checkCriuVersion checks CRIU version greater than or equal to minVersion.
93func (c *Container) checkCriuVersion(minVersion int) error {
94 // If the version of criu has already been determined there is no need
95 // to ask criu for the version again. Use the value from c.criuVersion.
96 if c.criuVersion != 0 {
97 return compareCriuVersion(c.criuVersion, minVersion)
98 }
99
100 criu := criu.MakeCriu()
101 var err error
102 c.criuVersion, err = criu.GetCriuVersion()
103 if err != nil {
104 return fmt.Errorf("CRIU version check failed: %w", err)
105 }
106
107 return compareCriuVersion(c.criuVersion, minVersion)
108}
109
110const descriptorsFilename = "descriptors.json"
111

Callers 4

criuSupportsExtNSMethod · 0.95
CheckpointMethod · 0.95
RestoreMethod · 0.95
criuNotificationsMethod · 0.95

Calls 1

compareCriuVersionFunction · 0.85

Tested by

no test coverage detected