Skip to content

Commit ae29480

Browse files
Merge pull request opencontainers#1561 from nseps/master
Add AutoDedup option to CriuOpts
2 parents 59bbdc4 + 3f234b1 commit ae29480

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

checkpoint.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ checkpointed.`,
3535
cli.BoolFlag{Name: "pre-dump", Usage: "dump container's memory information only, leave the container running after this"},
3636
cli.StringFlag{Name: "manage-cgroups-mode", Value: "", Usage: "cgroups mode: 'soft' (default), 'full' and 'strict'"},
3737
cli.StringSliceFlag{Name: "empty-ns", Usage: "create a namespace, but don't restore its properties"},
38+
cli.BoolFlag{Name: "auto-dedup", Usage: "enable auto deduplication of memory images"},
3839
},
3940
Action: func(context *cli.Context) error {
4041
if err := checkArgs(context, 1, exactArgs); err != nil {

libcontainer/container_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
811811
FileLocks: proto.Bool(criuOpts.FileLocks),
812812
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
813813
OrphanPtsMaster: proto.Bool(true),
814+
AutoDedup: proto.Bool(criuOpts.AutoDedup),
814815
}
815816

816817
fcg := c.cgroupManager.GetPaths()["freezer"]
@@ -1012,6 +1013,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
10121013
FileLocks: proto.Bool(criuOpts.FileLocks),
10131014
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
10141015
OrphanPtsMaster: proto.Bool(true),
1016+
AutoDedup: proto.Bool(criuOpts.AutoDedup),
10151017
},
10161018
}
10171019

libcontainer/criu_opts_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ type CriuOpts struct {
3434
VethPairs []VethPairName // pass the veth to criu when restore
3535
ManageCgroupsMode cgMode // dump or restore cgroup mode
3636
EmptyNs uint32 // don't c/r properties for namespace from this mask
37+
AutoDedup bool // auto deduplication for incremental dumps
3738
}

restore.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ using the runc checkpoint command.`,
8282
Name: "empty-ns",
8383
Usage: "create a namespace, but don't restore its properties",
8484
},
85+
cli.BoolFlag{
86+
Name: "auto-dedup",
87+
Usage: "enable auto deduplication of memory images",
88+
},
8589
},
8690
Action: func(context *cli.Context) error {
8791
if err := checkArgs(context, 1, exactArgs); err != nil {
@@ -123,5 +127,6 @@ func criuOptions(context *cli.Context) *libcontainer.CriuOpts {
123127
ShellJob: context.Bool("shell-job"),
124128
FileLocks: context.Bool("file-locks"),
125129
PreDump: context.Bool("pre-dump"),
130+
AutoDedup: context.Bool("auto-dedup"),
126131
}
127132
}

0 commit comments

Comments
 (0)