Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from alibaba/ali_huamin
Browse files Browse the repository at this point in the history
criu: apply two patch to support c/r function
  • Loading branch information
allencloud authored Aug 30, 2018
2 parents 30b507b + 30152c0 commit 451ee29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ var namespaceMapping = map[specs.LinuxNamespaceType]int{
}

func setEmptyNsMask(context *cli.Context, options *libcontainer.CriuOpts) error {
var nsmask int
/* Runc doesn't manage network devices and their configuration */
nsmask := unix.CLONE_NEWNET

for _, ns := range context.StringSlice("empty-ns") {
f, exists := namespaceMapping[specs.LinuxNamespaceType(ns)]
Expand Down
3 changes: 3 additions & 0 deletions restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ using the runc checkpoint command.`,
return err
}
options := criuOptions(context)
if err := setEmptyNsMask(context, options); err != nil {
return err
}
status, err := startContainer(context, spec, CT_ACT_RESTORE, options)
if err != nil {
return err
Expand Down

0 comments on commit 451ee29

Please sign in to comment.