build(deps): bump github.com/checkpoint-restore/go-criu/v7

Bumps [github.com/checkpoint-restore/go-criu/v7](https://github.com/checkpoint-restore/go-criu) from 7.1.0 to 7.2.0.
- [Release notes](https://github.com/checkpoint-restore/go-criu/releases)
- [Commits](https://github.com/checkpoint-restore/go-criu/compare/v7.1.0...v7.2.0)

---
updated-dependencies:
- dependency-name: github.com/checkpoint-restore/go-criu/v7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-09-09 23:33:48 +00:00
committed by GitHub
parent 19430264c1
commit 1dedcb7841
34 changed files with 414 additions and 24 deletions

View File

@@ -15,3 +15,4 @@ scripts/magic-gen/expected.go
scripts/magic-gen/output.go
crit/bin
crit/test-imgs/
__pycache__

View File

@@ -16,3 +16,7 @@ linters:
linters-settings:
exhaustive:
default-signifies-exhaustive: true
gosec:
excludes:
# https://github.com/securego/gosec/issues/1185
- G115

View File

@@ -18,9 +18,6 @@ test: build
coverage:
$(MAKE) -C test coverage
codecov:
$(MAKE) -C test codecov
rpc/rpc.proto:
curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/rpc.proto -o $@
@@ -42,4 +39,4 @@ clean:
$(MAKE) -C crit/ clean
$(MAKE) -C test/ clean
.PHONY: build test lint vendor coverage codecov clean
.PHONY: build test lint vendor coverage clean

View File

@@ -62,7 +62,8 @@ The following table shows the relation between go-criu and criu versions:
| Major version | Latest release | CRIU version |
| -------------- | -------------- | ------------ |
| v7             | 7.1.0         | 3.18         |
| v7             | 7.2.0         | 3.19         |
| v7             | 7.0.0         | 3.18         |
| v6             | 6.3.0         | 3.17         |
| v5             | 5.3.0         | 3.16         |
| v5             | 5.0.0         | 3.15         |

View File

@@ -61,13 +61,19 @@ func (c *Criu) Prepare() error {
}
// Cleanup cleans up
func (c *Criu) Cleanup() {
func (c *Criu) Cleanup() error {
var errs []error
if c.swrkCmd != nil {
c.swrkSk.Close()
if err := c.swrkSk.Close(); err != nil {
errs = append(errs, err)
}
c.swrkSk = nil
_ = c.swrkCmd.Wait()
if err := c.swrkCmd.Wait(); err != nil {
errs = append(errs, fmt.Errorf("criu swrk failed: %w", err))
}
c.swrkCmd = nil
}
return errors.Join(errs...)
}
func (c *Criu) sendAndRecv(reqB []byte) ([]byte, int, error) {
@@ -99,9 +105,7 @@ func (c *Criu) doSwrk(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify) e
return nil
}
func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (*rpc.CriuResp, error) {
var resp *rpc.CriuResp
func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (resp *rpc.CriuResp, retErr error) {
req := rpc.CriuReq{
Type: &reqType,
Opts: opts,
@@ -121,7 +125,13 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
return nil, err
}
defer c.Cleanup()
defer func() {
// append any cleanup errors to the returned error
err := c.Cleanup()
if err != nil {
retErr = errors.Join(retErr, err)
}
}()
}
for {