Skip to content

Commit

Permalink
Update to latest criu libcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
boucher committed May 6, 2015
1 parent b7d6299 commit ab1c86b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions vendor/src/github.com/docker/libcontainer/container_linux.go
Expand Up @@ -279,13 +279,15 @@ func (c *linuxContainer) checkCriuVersion() error {
return fmt.Errorf("Unable to parse the CRIU version: %s", out)
}

if x*10000+y*100+z < 10501 {
return fmt.Errorf("CRIU version must be 1.5.1 or higher")
if x*10000+y*100+z < 10502 {
return fmt.Errorf("CRIU version must be 1.5.2 or higher")
}

return nil
}

const descriptors_filename = "descriptors.json"

func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
c.m.Lock()
defer c.m.Unlock()
Expand Down Expand Up @@ -374,7 +376,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
return err
}

err = ioutil.WriteFile(filepath.Join(criuOpts.ImagesDirectory, "std_fds.json"), fdsJSON, 0655)
err = ioutil.WriteFile(filepath.Join(criuOpts.ImagesDirectory, descriptors_filename), fdsJSON, 0655)
if err != nil {
return err
}
Expand Down Expand Up @@ -488,14 +490,16 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
}
}

var fds []string
fdJSON, err := ioutil.ReadFile(filepath.Join(criuOpts.ImagesDirectory, "std_fds.json"))
if err != nil {
var (
fds []string
fdJSON []byte
)

if fdJSON, err = ioutil.ReadFile(filepath.Join(criuOpts.ImagesDirectory, descriptors_filename)); err != nil {
return err
}

err = json.Unmarshal(fdJSON, &fds)
if err != nil {
if err = json.Unmarshal(fdJSON, &fds); err != nil {
return err
}

Expand Down

0 comments on commit ab1c86b

Please sign in to comment.