mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
checkpoint/restore: add --manage-cgroups-mode ignore
- add the new mode and document it; - slightly improve the --help output; - slightly simplify the parsing code. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
+7
-5
@@ -38,7 +38,7 @@ checkpointed.`,
|
||||
cli.StringFlag{Name: "page-server", Value: "", Usage: "ADDRESS:PORT of the page server"},
|
||||
cli.BoolFlag{Name: "file-locks", Usage: "handle file locks, for safety"},
|
||||
cli.BoolFlag{Name: "pre-dump", Usage: "dump container's memory information only, leave the container running after this"},
|
||||
cli.StringFlag{Name: "manage-cgroups-mode", Value: "", Usage: "cgroups mode: 'soft' (default), 'full' and 'strict'"},
|
||||
cli.StringFlag{Name: "manage-cgroups-mode", Value: "", Usage: "cgroups mode: soft|full|strict|ignore (default: soft)"},
|
||||
cli.StringSliceFlag{Name: "empty-ns", Usage: "create a namespace, but don't restore its properties"},
|
||||
cli.BoolFlag{Name: "auto-dedup", Usage: "enable auto deduplication of memory images"},
|
||||
},
|
||||
@@ -149,17 +149,19 @@ func criuOptions(context *cli.Context) (*libcontainer.CriuOpts, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if cgOpt := context.String("manage-cgroups-mode"); cgOpt != "" {
|
||||
switch cgOpt {
|
||||
switch context.String("manage-cgroups-mode") {
|
||||
case "":
|
||||
// do nothing
|
||||
case "soft":
|
||||
opts.ManageCgroupsMode = criu.CriuCgMode_SOFT
|
||||
case "full":
|
||||
opts.ManageCgroupsMode = criu.CriuCgMode_FULL
|
||||
case "strict":
|
||||
opts.ManageCgroupsMode = criu.CriuCgMode_STRICT
|
||||
case "ignore":
|
||||
opts.ManageCgroupsMode = criu.CriuCgMode_IGNORE
|
||||
default:
|
||||
return nil, errors.New("Invalid manage cgroups mode")
|
||||
}
|
||||
return nil, errors.New("Invalid manage-cgroups-mode value")
|
||||
}
|
||||
|
||||
// runc doesn't manage network devices and their configuration.
|
||||
|
||||
@@ -57,7 +57,7 @@ together with **criu lazy-pages**. See
|
||||
: Do a pre-dump, i.e. dump container's memory information only, leaving the
|
||||
container running. See [criu iterative migration](https://criu.org/Iterative_migration).
|
||||
|
||||
**--manage-cgroups-mode** **soft**|**full**|**strict**.
|
||||
**--manage-cgroups-mode** **soft**|**full**|**strict**|**ignore**.
|
||||
: Cgroups mode. Default is **soft**. See
|
||||
[criu --manage-cgroups option](https://criu.org/CLI/opt/--manage-cgroups).
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ image files directory.
|
||||
: Allow checkpoint/restore of file locks. See
|
||||
[criu --file-locks option](https://criu.org/CLI/opt/--file-locks).
|
||||
|
||||
**--manage-cgroups-mode** **soft**|**full**|**strict**.
|
||||
**--manage-cgroups-mode** **soft**|**full**|**strict**|**ignore**.
|
||||
: Cgroups mode. Default is **soft**. See
|
||||
[criu --manage-cgroups option](https://criu.org/CLI/opt/--manage-cgroups).
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ using the runc checkpoint command.`,
|
||||
cli.StringFlag{
|
||||
Name: "manage-cgroups-mode",
|
||||
Value: "",
|
||||
Usage: "cgroups mode: 'soft' (default), 'full' and 'strict'",
|
||||
Usage: "cgroups mode: soft|full|strict|ignore (default: soft)",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "bundle, b",
|
||||
|
||||
Reference in New Issue
Block a user