checkCriuVersion checks CRIU version greater than or equal to minVersion.
(minVersion int)
| 91 | |
| 92 | // checkCriuVersion checks CRIU version greater than or equal to minVersion. |
| 93 | func (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 | |
| 110 | const descriptorsFilename = "descriptors.json" |
| 111 |
no test coverage detected