Commit f466f811 authored by zhul's avatar zhul 🌵

去除代码中 criu 相关内容

parent 1859290d
CRIU(8) CRBK(8)
======= =======
include::footer.txt[] include::footer.txt[]
NAME NAME
---- ----
criu - checkpoint/restore in userspace crbk - checkpoint/restore in userspace
SYNOPSIS SYNOPSIS
-------- --------
*criu* 'command' ['option' ...] *crbk* 'command' ['option' ...]
DESCRIPTION DESCRIPTION
----------- -----------
*criu* is a tool for checkpointing and restoring running applications. *crbk* is a tool for checkpointing and restoring running applications.
It does this by saving their state as a collection of files (see the *dump* It does this by saving their state as a collection of files (see the *dump*
command) and creating equivalent processes from those files (see the *restore* command) and creating equivalent processes from those files (see the *restore*
command). The restore operation can be performed at a later time, command). The restore operation can be performed at a later time,
...@@ -54,7 +54,7 @@ The following levels are available: ...@@ -54,7 +54,7 @@ The following levels are available:
above plus lots of debug. above plus lots of debug.
*--config* 'file':: *--config* 'file'::
Pass a specific configuration file to criu. Pass a specific configuration file to crbk.
*--no-default-config*:: *--no-default-config*::
Forbid parsing of default configuration files. Forbid parsing of default configuration files.
...@@ -66,7 +66,7 @@ The following levels are available: ...@@ -66,7 +66,7 @@ The following levels are available:
Write logging messages to 'file'. Write logging messages to 'file'.
*--display-stats*:: *--display-stats*::
During dump as well as during restore *criu* collects information During dump as well as during restore *crbk* collects information
like the time required to dump or restore the process or the like the time required to dump or restore the process or the
number of pages dumped or restored. This information is always number of pages dumped or restored. This information is always
written to the files 'stats-dump' and 'stats-restore' and can written to the files 'stats-dump' and 'stats-restore' and can
...@@ -146,9 +146,9 @@ The following levels are available: ...@@ -146,9 +146,9 @@ The following levels are available:
*pre-dump* *pre-dump*
~~~~~~~~~~ ~~~~~~~~~~
Performs the pre-dump procedure, during which *criu* creates a snapshot of Performs the pre-dump procedure, during which *crbk* creates a snapshot of
memory changes since the previous *pre-dump*. Note that during this memory changes since the previous *pre-dump*. Note that during this
*criu* also creates the fsnotify cache which speeds up the *restore* *crbk* also creates the fsnotify cache which speeds up the *restore*
procedure. *pre-dump* requires at least *-t* option (see *dump* below). procedure. *pre-dump* requires at least *-t* option (see *dump* below).
In addition, *page-server* options may be specified. In addition, *page-server* options may be specified.
...@@ -170,7 +170,7 @@ Performs a checkpoint procedure. ...@@ -170,7 +170,7 @@ Performs a checkpoint procedure.
+ +
Note if task is about to run after been checkpointed, it can modify Note if task is about to run after been checkpointed, it can modify
TCP connections, delete files and do other dangerous actions. Therefore, TCP connections, delete files and do other dangerous actions. Therefore,
*criu* can not guarantee that the next *restore* action will succeed. *crbk* can not guarantee that the next *restore* action will succeed.
Most likely if this option is used, at least the file system snapshot Most likely if this option is used, at least the file system snapshot
must be made with the help of *post-dump* action script. must be made with the help of *post-dump* action script.
+ +
...@@ -202,7 +202,7 @@ In other words, do not use it unless really needed. ...@@ -202,7 +202,7 @@ In other words, do not use it unless really needed.
*--external dev[*'major'*/*'minor'*]:*'name':: *--external dev[*'major'*/*'minor'*]:*'name'::
Allow to dump a mount namespace having a real block device mounted. Allow to dump a mount namespace having a real block device mounted.
A block device is identified by its 'major' and 'minor' numbers, A block device is identified by its 'major' and 'minor' numbers,
and *criu* saves its information to image under the identifier 'name'. and *crbk* saves its information to image under the identifier 'name'.
*--external file[*'mnt_id'*:*'inode'*]*:: *--external file[*'mnt_id'*:*'inode'*]*::
Dump an external file, i.e. an opened file that is can not be resolved Dump an external file, i.e. an opened file that is can not be resolved
...@@ -215,7 +215,7 @@ In other words, do not use it unless really needed. ...@@ -215,7 +215,7 @@ In other words, do not use it unless really needed.
returned by *stat*(2). returned by *stat*(2).
*--external unix[*'id'*]*:: *--external unix[*'id'*]*::
Tell *criu* that one end of a pair of UNIX sockets (created by Tell *crbk* that one end of a pair of UNIX sockets (created by
*socketpair*(2)) with 'id' is OK to be disconnected. *socketpair*(2)) with 'id' is OK to be disconnected.
*--freeze-cgroup*:: *--freeze-cgroup*::
...@@ -223,12 +223,12 @@ In other words, do not use it unless really needed. ...@@ -223,12 +223,12 @@ In other words, do not use it unless really needed.
*--manage-cgroups*:: *--manage-cgroups*::
Collect cgroups into the image thus they gonna be restored then. Collect cgroups into the image thus they gonna be restored then.
Without this option, *criu* will not save cgroups configuration Without this option, *crbk* will not save cgroups configuration
associated with a task. associated with a task.
*--cgroup-props* 'spec':: *--cgroup-props* 'spec'::
Specify controllers and their properties to be saved into the Specify controllers and their properties to be saved into the
image file. *criu* predefines specifications for common controllers, image file. *crbk* predefines specifications for common controllers,
but since the kernel can add new controllers and modify their but since the kernel can add new controllers and modify their
properties, there should be a way to specify ones matched the kernel. properties, there should be a way to specify ones matched the kernel.
+ +
...@@ -249,7 +249,7 @@ their properties. ...@@ -249,7 +249,7 @@ their properties.
+ +
Note the format: double quotes, spaces and new lines are required. Note the format: double quotes, spaces and new lines are required.
The 'strategy' specifies what to do if a controller specified already The 'strategy' specifies what to do if a controller specified already
exists as a built-in one: *criu* can either *merge* or *replace* such. exists as a built-in one: *crbk* can either *merge* or *replace* such.
+ +
For example, the command line for the above example should look like this: For example, the command line for the above example should look like this:
+ +
...@@ -264,10 +264,10 @@ For example, the command line for the above example should look like this: ...@@ -264,10 +264,10 @@ For example, the command line for the above example should look like this:
*--cgroup-dump-controller* 'name':: *--cgroup-dump-controller* 'name'::
Dump a controller with 'name' only, skipping anything else that was Dump a controller with 'name' only, skipping anything else that was
discovered automatically (usually via */proc*). This option is discovered automatically (usually via */proc*). This option is
useful when one needs *criu* to skip some controllers. useful when one needs *crbk* to skip some controllers.
*--cgroup-props-ignore-default*:: *--cgroup-props-ignore-default*::
When combined with *--cgroup-props*, makes *criu* substitute When combined with *--cgroup-props*, makes *crbk* substitute
a predefined controller property with the new one shipped. If the option a predefined controller property with the new one shipped. If the option
is not used, the predefined properties are merged with the provided ones. is not used, the predefined properties are merged with the provided ones.
...@@ -276,7 +276,7 @@ For example, the command line for the above example should look like this: ...@@ -276,7 +276,7 @@ For example, the command line for the above example should look like this:
*--skip-in-flight*:: *--skip-in-flight*::
This option skips in-flight TCP connections. If any TCP connections This option skips in-flight TCP connections. If any TCP connections
that are not yet completely established are found, *criu* ignores that are not yet completely established are found, *crbk* ignores
these connections, rather than errors out. these connections, rather than errors out.
The TCP stack on the client side is expected to handle the The TCP stack on the client side is expected to handle the
re-connect gracefully. re-connect gracefully.
...@@ -312,7 +312,7 @@ For example, the command line for the above example should look like this: ...@@ -312,7 +312,7 @@ For example, the command line for the above example should look like this:
*-j*, *--shell-job*:: *-j*, *--shell-job*::
Allow one to dump shell jobs. This implies the restored task will Allow one to dump shell jobs. This implies the restored task will
inherit session and process group ID from the *criu* itself. inherit session and process group ID from the *crbk* itself.
This option also allows to migrate a single external tty connection, This option also allows to migrate a single external tty connection,
to migrate applications like *top*. If used with *dump* command, to migrate applications like *top*. If used with *dump* command,
it must be specified with *restore* as well. it must be specified with *restore* as well.
...@@ -332,7 +332,7 @@ For example, the command line for the above example should look like this: ...@@ -332,7 +332,7 @@ For example, the command line for the above example should look like this:
By default the option is set to *fpu* and *ins*. By default the option is set to *fpu* and *ins*.
*--cgroup-root* ['controller':]/'newroot':: *--cgroup-root* ['controller':]/'newroot'::
Change the root for the controller that will be dumped. By default, *criu* Change the root for the controller that will be dumped. By default, *crbk*
simply dumps everything below where any of the tasks live. However, if a simply dumps everything below where any of the tasks live. However, if a
container moves all of its tasks into a cgroup directory below the container container moves all of its tasks into a cgroup directory below the container
engine's default directory for tasks, permissions will not be preserved on engine's default directory for tasks, permissions will not be preserved on
...@@ -352,7 +352,7 @@ By default the option is set to *fpu* and *ins*. ...@@ -352,7 +352,7 @@ By default the option is set to *fpu* and *ins*.
Restores previously checkpointed processes. Restores previously checkpointed processes.
*--inherit-fd* *fd[*'N'*]:*'resource':: *--inherit-fd* *fd[*'N'*]:*'resource'::
Inherit a file descriptor. This option lets *criu* use an already opened Inherit a file descriptor. This option lets *crbk* use an already opened
file descriptor 'N' for restoring a file identified by 'resource'. file descriptor 'N' for restoring a file identified by 'resource'.
This option can be used to restore an external resource dumped This option can be used to restore an external resource dumped
with the help of *--external* *file*, *tty*, and *unix* options. with the help of *--external* *file*, *tty*, and *unix* options.
...@@ -370,7 +370,7 @@ Note that square brackets used in this option arguments are literals and ...@@ -370,7 +370,7 @@ Note that square brackets used in this option arguments are literals and
usually need to be escaped from shell. usually need to be escaped from shell.
*-d*, *--restore-detached*:: *-d*, *--restore-detached*::
Detach *criu* itself once restore is complete. Detach *crbk* itself once restore is complete.
*-s*, *--leave-stopped*:: *-s*, *--leave-stopped*::
Leave tasks in stopped state after restore (rather than resuming Leave tasks in stopped state after restore (rather than resuming
...@@ -417,12 +417,12 @@ usually need to be escaped from shell. ...@@ -417,12 +417,12 @@ usually need to be escaped from shell.
*--external macvlan[*'inner_dev'*]:*'outer_dev':: *--external macvlan[*'inner_dev'*]:*'outer_dev'::
When restoring an image that have a MacVLAN device in it, this option When restoring an image that have a MacVLAN device in it, this option
must be used to specify to which 'outer_dev' (an existing network device must be used to specify to which 'outer_dev' (an existing network device
in CRIU namespace) the restored 'inner_dev' should be bound to. in CRBK namespace) the restored 'inner_dev' should be bound to.
*--manage-cgroups* ['mode']:: *--manage-cgroups* ['mode']::
Restore cgroups configuration associated with a task from the image. Restore cgroups configuration associated with a task from the image.
Controllers are always restored in an optimistic way -- if already present Controllers are always restored in an optimistic way -- if already present
in system, *criu* reuses it, otherwise it will be created. in system, *crbk* reuses it, otherwise it will be created.
The 'mode' may be one of the following: The 'mode' may be one of the following:
...@@ -432,7 +432,7 @@ The 'mode' may be one of the following: ...@@ -432,7 +432,7 @@ The 'mode' may be one of the following:
*props*::: Restore cgroup properties and require cgroup to pre-exist. *props*::: Restore cgroup properties and require cgroup to pre-exist.
*soft*::: Restore cgroup properties if only cgroup has been created *soft*::: Restore cgroup properties if only cgroup has been created
by *criu*, otherwise do not restore properties. This is the by *crbk*, otherwise do not restore properties. This is the
default if mode is unspecified. default if mode is unspecified.
*full*::: Always restore all cgroups and their properties. *full*::: Always restore all cgroups and their properties.
...@@ -467,7 +467,7 @@ The 'mode' may be one of the following: ...@@ -467,7 +467,7 @@ The 'mode' may be one of the following:
*-j*, *--shell-job*:: *-j*, *--shell-job*::
Restore shell jobs, in other words inherit session and process group Restore shell jobs, in other words inherit session and process group
ID from the criu itself. ID from the crbk itself.
*--cpu-cap* ['cap'[,'cap'...]]:: *--cpu-cap* ['cap'[,'cap'...]]::
Specify CPU capabilities to be present on the CPU the process is Specify CPU capabilities to be present on the CPU the process is
...@@ -498,7 +498,7 @@ The 'mode' may be one of the following: ...@@ -498,7 +498,7 @@ The 'mode' may be one of the following:
+ +
For example, this option can be used in case *--cpu-cap=cpu* was used For example, this option can be used in case *--cpu-cap=cpu* was used
during *dump*, and images are migrated to a less capable CPU and are during *dump*, and images are migrated to a less capable CPU and are
to be restored. By default, *criu* shows an error that CPU capabilities to be restored. By default, *crbk* shows an error that CPU capabilities
are not adequate, but this can be suppressed by using *--cpu-cap=none*. are not adequate, but this can be suppressed by using *--cpu-cap=none*.
*--weak-sysctls*:: *--weak-sysctls*::
...@@ -516,10 +516,10 @@ are not adequate, but this can be suppressed by using *--cpu-cap=none*. ...@@ -516,10 +516,10 @@ are not adequate, but this can be suppressed by using *--cpu-cap=none*.
*check* *check*
~~~~~~~ ~~~~~~~
Checks whether the kernel supports the features needed by *criu* to Checks whether the kernel supports the features needed by *crbk* to
dump and restore a process tree. dump and restore a process tree.
There are three categories of kernel support, as described below. *criu There are three categories of kernel support, as described below. *crbk
check* always checks Category 1 features unless *--feature* is specified check* always checks Category 1 features unless *--feature* is specified
which only checks a specified feature. which only checks a specified feature.
...@@ -536,16 +536,16 @@ which only checks a specified feature. ...@@ -536,16 +536,16 @@ which only checks a specified feature.
are used for experimental purposes (mostly are used for experimental purposes (mostly
during development). during development).
If there are no errors or warnings, *criu* prints "Looks good." and its If there are no errors or warnings, *crbk* prints "Looks good." and its
exit code is 0. exit code is 0.
A missing Category 1 feature causes *criu* to print "Does not look good." A missing Category 1 feature causes *crbk* to print "Does not look good."
and its exit code is non-zero. and its exit code is non-zero.
Missing Category 2 and 3 features cause *criu* to print "Looks good but Missing Category 2 and 3 features cause *crbk* to print "Looks good but
..." and its exit code is be non-zero. ..." and its exit code is be non-zero.
Without any options, *criu check* checks Category 1 features. This Without any options, *crbk check* checks Category 1 features. This
behavior can be changed by using the following options: behavior can be changed by using the following options:
*--extra*:: *--extra*::
...@@ -563,7 +563,7 @@ behavior can be changed by using the following options: ...@@ -563,7 +563,7 @@ behavior can be changed by using the following options:
*page-server* *page-server*
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Launches *criu* in page server mode. Launches *crbk* in page server mode.
*--daemon*:: *--daemon*::
Runs page server as a daemon (background process). Runs page server as a daemon (background process).
...@@ -594,7 +594,7 @@ Launches *criu* in page server mode. ...@@ -594,7 +594,7 @@ Launches *criu* in page server mode.
*lazy-pages* *lazy-pages*
~~~~~~~~~~~~ ~~~~~~~~~~~~
Launches *criu* in lazy-pages daemon mode. Launches *crbk* in lazy-pages daemon mode.
The *lazy-pages* daemon is responsible for managing user-level demand The *lazy-pages* daemon is responsible for managing user-level demand
paging for the restored processes. It gets information required to paging for the restored processes. It gets information required to
...@@ -611,14 +611,14 @@ is deprecated; please use *Compel* instead. ...@@ -611,14 +611,14 @@ is deprecated; please use *Compel* instead.
*service* *service*
~~~~~~~~~ ~~~~~~~~~
Launches *criu* in RPC daemon mode, where *criu* is listening for Launches *crbk* in RPC daemon mode, where *crbk* is listening for
RPC commands over socket to perform. This is convenient for a RPC commands over socket to perform. This is convenient for a
case where daemon itself is running in a privileged (superuser) mode case where daemon itself is running in a privileged (superuser) mode
but clients are not. but clients are not.
dedup dedup
~~~~~ ~~~~~
Starts pagemap data deduplication procedure, where *criu* scans over all Starts pagemap data deduplication procedure, where *crbk* scans over all
pagemap files and tries to minimize the number of pagemap entries by pagemap files and tries to minimize the number of pagemap entries by
obtaining the references from a parent pagemap image. obtaining the references from a parent pagemap image.
...@@ -628,7 +628,7 @@ Fetches current CPU features and write them into an image file. ...@@ -628,7 +628,7 @@ Fetches current CPU features and write them into an image file.
cpuinfo check cpuinfo check
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Fetches current CPU features (i.e. CPU the *criu* is running on) and test if Fetches current CPU features (i.e. CPU the *crbk* is running on) and test if
they are compatible with the ones present in an image file. they are compatible with the ones present in an image file.
...@@ -638,16 +638,16 @@ CONFIGURATION FILES ...@@ -638,16 +638,16 @@ CONFIGURATION FILES
option on command line, which is useful especially with repeated usage of option on command line, which is useful especially with repeated usage of
same options. A specific configuration file can be passed with same options. A specific configuration file can be passed with
the "*--config* 'file'" option. If no file is passed, the default configuration the "*--config* 'file'" option. If no file is passed, the default configuration
files '/etc/criu/default.conf' and '$HOME/.criu/default.conf' are parsed (if files '/etc/crbk/default.conf' and '$HOME/.crbk/default.conf' are parsed (if
present on the system). If the environment variable CRIU_CONFIG_FILE is set, present on the system). If the environment variable CRBK_CONFIG_FILE is set,
it will also be parsed. it will also be parsed.
The options passed to CRIU via CLI, RPC or configuration file are evaluated The options passed to CRBK via CLI, RPC or configuration file are evaluated
in the following order: in the following order:
- apply_config(/etc/criu/default.conf) - apply_config(/etc/crbk/default.conf)
- apply_config($HOME/.criu/default.conf) - apply_config($HOME/.crbk/default.conf)
- apply_config(CRIU_CONFIG_FILE) - apply_config(CRBK_CONFIG_FILE)
- apply_config(*--config* 'file') - apply_config(*--config* 'file')
- apply_config(CLI) or apply_config(RPC) - apply_config(CLI) or apply_config(RPC)
- apply_config(RPC configuration file) (only for RPC mode) - apply_config(RPC configuration file) (only for RPC mode)
...@@ -669,20 +669,20 @@ are interpreted literally. ...@@ -669,20 +669,20 @@ are interpreted literally.
Example of configuration file to illustrate syntax: Example of configuration file to illustrate syntax:
--------------- ---------------
$ cat ~/.criu/default.conf $ cat ~/.crbk/default.conf
tcp-established tcp-established
work-dir "/home/USERNAME/criu/my \"work\" directory" work-dir "/home/USERNAME/crbk/my \"work\" directory"
#this is a comment #this is a comment
no-restore-sibling # this is another comment no-restore-sibling # this is another comment
--------------- ---------------
Configuration files in RPC mode Configuration files in RPC mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Not only does *criu* evaluate configuration files in CLI mode, it also Not only does *crbk* evaluate configuration files in CLI mode, it also
evaluates configuration files in RPC mode. Just as in CLI mode the evaluates configuration files in RPC mode. Just as in CLI mode the
configuration file values are evaluated first. This means that any option configuration file values are evaluated first. This means that any option
set via RPC will overwrite the configuration file setting. The user can set via RPC will overwrite the configuration file setting. The user can
thus change *criu*'s default behavior but it is not possible to change thus change *crbk*'s default behavior but it is not possible to change
settings which are explicitly set by the RPC client. settings which are explicitly set by the RPC client.
The RPC client can, however, specify an additional configuration file The RPC client can, however, specify an additional configuration file
...@@ -690,7 +690,7 @@ which will be evaluated after the RPC options (see above for option evaluation ...@@ -690,7 +690,7 @@ which will be evaluated after the RPC options (see above for option evaluation
order). The RPC client can specify this additional configuration file order). The RPC client can specify this additional configuration file
via "req.opts.config_file = '/path/to/file'". The values from this via "req.opts.config_file = '/path/to/file'". The values from this
configuration file will overwrite all other configuration file settings configuration file will overwrite all other configuration file settings
or RPC options. *This can lead to undesired behavior of criu and or RPC options. *This can lead to undesired behavior of crbk and
should only be used carefully.* should only be used carefully.*
EXAMPLES EXAMPLES
...@@ -699,19 +699,19 @@ To checkpoint a program with pid of *1234* and write all image files into ...@@ -699,19 +699,19 @@ To checkpoint a program with pid of *1234* and write all image files into
directory *checkpoint*: directory *checkpoint*:
---------- ----------
criu dump -D checkpoint -t 1234 crbk dump -D checkpoint -t 1234
---------- ----------
To restore this program detaching criu itself: To restore this program detaching crbk itself:
---------- ----------
criu restore -d -D checkpoint crbk restore -d -D checkpoint
---------- ----------
AUTHOR AUTHOR
------ ------
The CRIU team. The CRBK team.
COPYRIGHT COPYRIGHT
......
...@@ -122,7 +122,7 @@ ifeq ($(GMON),1) ...@@ -122,7 +122,7 @@ ifeq ($(GMON),1)
export GMON GMONLDOPT export GMON GMONLDOPT
endif endif
CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/ CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/ -w
HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/ HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
export CFLAGS USERCLFAGS HOSTCFLAGS export CFLAGS USERCLFAGS HOSTCFLAGS
......
...@@ -29,7 +29,7 @@ export PREFIX BINDIR SBINDIR MANDIR RUNDIR ...@@ -29,7 +29,7 @@ export PREFIX BINDIR SBINDIR MANDIR RUNDIR
export LIBDIR INCLUDEDIR LIBEXECDIR export LIBDIR INCLUDEDIR LIBEXECDIR
install-man: install-man:
$(Q) $(MAKE) -C Documentation install #$(Q) $(MAKE) -C Documentation install
.PHONY: install-man .PHONY: install-man
install-lib: lib install-lib: lib
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "types.h" #include "types.h"
#include "asm/compat.h" #include "asm/compat.h"
#include <stdlib.h>
#undef LOG_PREFIX #undef LOG_PREFIX
#define LOG_PREFIX "x86: " #define LOG_PREFIX "x86: "
...@@ -16,6 +17,9 @@ ...@@ -16,6 +17,9 @@
#define XSAVE_PB_NELEMS(__s, __obj, __member) \ #define XSAVE_PB_NELEMS(__s, __obj, __member) \
(sizeof(__s) / sizeof(*(__obj)->__member)) (sizeof(__s) / sizeof(*(__obj)->__member))
char *rpc_cfg_file = NULL;
int save_task_regs(void *x, user_regs_struct_t *regs, user_fpregs_struct_t *fpregs) int save_task_regs(void *x, user_regs_struct_t *regs, user_fpregs_struct_t *fpregs)
{ {
CoreEntry *core = x; CoreEntry *core = x;
......
...@@ -204,7 +204,7 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -204,7 +204,7 @@ int main(int argc, char *argv[], char *envp[])
if (!strcmp(argv[optind], "restore")) { if (!strcmp(argv[optind], "restore")) {
if (opts.tree_id) if (opts.tree_id)
pr_warn("Using -t with criu restore is obsoleted\n"); pr_warn("Using -t with crbk restore is obsoleted\n");
ret = cr_restore_tasks(); ret = cr_restore_tasks();
if (ret == 0 && opts.exec_cmd) { if (ret == 0 && opts.exec_cmd) {
...@@ -256,15 +256,19 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -256,15 +256,19 @@ int main(int argc, char *argv[], char *envp[])
pr_msg("Error: unknown command: %s\n", argv[optind]); pr_msg("Error: unknown command: %s\n", argv[optind]);
usage: usage:
if (usage_error) {
return 1;
}
return 0;
pr_msg("\n" pr_msg("\n"
"Usage:\n" "Usage:\n"
" criu dump|pre-dump -t PID [<options>]\n" " crbk dump|pre-dump -t PID [<options>]\n"
" criu restore [<options>]\n" " crbk restore [<options>]\n"
" criu check [--feature FEAT]\n" " crbk check [--feature FEAT]\n"
" criu page-server\n" " crbk page-server\n"
" criu service [<options>]\n" " crbk service [<options>]\n"
" criu dedup\n" " crbk dedup\n"
" criu lazy-pages -D DIR [<options>]\n" " crbk lazy-pages -D DIR [<options>]\n"
"\n" "\n"
"Commands:\n" "Commands:\n"
" dump checkpoint a process/tree identified by pid\n" " dump checkpoint a process/tree identified by pid\n"
...@@ -309,8 +313,8 @@ usage: ...@@ -309,8 +313,8 @@ usage:
" --freeze-cgroup use cgroup freezer to collect processes\n" " --freeze-cgroup use cgroup freezer to collect processes\n"
" --weak-sysctls skip restoring sysctls that are not available\n" " --weak-sysctls skip restoring sysctls that are not available\n"
" --lazy-pages restore pages on demand\n" " --lazy-pages restore pages on demand\n"
" this requires running a second instance of criu\n" " this requires running a second instance of crbk\n"
" in lazy-pages mode: 'criu lazy-pages -D DIR'\n" " in lazy-pages mode: 'crbk lazy-pages -D DIR'\n"
" --lazy-pages and lazy-pages mode require userfaultfd\n" " --lazy-pages and lazy-pages mode require userfaultfd\n"
"\n" "\n"
"* External resources support:\n" "* External resources support:\n"
...@@ -340,7 +344,7 @@ usage: ...@@ -340,7 +344,7 @@ usage:
" --action-script FILE add an external action script\n" " --action-script FILE add an external action script\n"
" -j|--" OPT_SHELL_JOB " allow one to dump and restore shell jobs\n" " -j|--" OPT_SHELL_JOB " allow one to dump and restore shell jobs\n"
" -l|--" OPT_FILE_LOCKS " handle file locks, for safety, only used for container\n" " -l|--" OPT_FILE_LOCKS " handle file locks, for safety, only used for container\n"
" -L|--libdir path to a plugin directory (by default " CR_PLUGIN_DEFAULT ")\n" " -L|--libdir path to a plugin directory\n"
" --force-irmap force resolving names for inotify/fsnotify watches\n" " --force-irmap force resolving names for inotify/fsnotify watches\n"
" --irmap-scan-path FILE\n" " --irmap-scan-path FILE\n"
" add a path the irmap hints to scan\n" " add a path the irmap hints to scan\n"
...@@ -368,7 +372,7 @@ usage: ...@@ -368,7 +372,7 @@ usage:
" The type can be either 'apparmor' or 'selinux'.\n" " The type can be either 'apparmor' or 'selinux'.\n"
" --skip-mnt PATH ignore this mountpoint when dumping the mount namespace\n" " --skip-mnt PATH ignore this mountpoint when dumping the mount namespace\n"
" --enable-fs FSNAMES a comma separated list of filesystem names or \"all\"\n" " --enable-fs FSNAMES a comma separated list of filesystem names or \"all\"\n"
" force criu to (try to) dump/restore these filesystem's\n" " force crbk to (try to) dump/restore these filesystem's\n"
" mountpoints even if fs is not supported\n" " mountpoints even if fs is not supported\n"
" --inherit-fd fd[NUM]:RES\n" " --inherit-fd fd[NUM]:RES\n"
" Inherit file descriptors, treating fd NUM as being\n" " Inherit file descriptors, treating fd NUM as being\n"
...@@ -387,7 +391,7 @@ usage: ...@@ -387,7 +391,7 @@ usage:
" user:PID,UID,GID\n" " user:PID,UID,GID\n"
"\n" "\n"
"Check options:\n" "Check options:\n"
" Without options, \"criu check\" checks availability of absolutely required\n" " Without options, \"crbk check\" checks availability of absolutely required\n"
" kernel features, critical for performing dump and restore.\n" " kernel features, critical for performing dump and restore.\n"
" --extra add check for extra kernel features\n" " --extra add check for extra kernel features\n"
" --experimental add check for experimental kernel features\n" " --experimental add check for experimental kernel features\n"
......
...@@ -141,7 +141,7 @@ struct cr_options { ...@@ -141,7 +141,7 @@ struct cr_options {
}; };
extern struct cr_options opts; extern struct cr_options opts;
char *rpc_cfg_file; extern char *rpc_cfg_file;
extern int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd, int state); extern int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd, int state);
extern int check_options(); extern int check_options();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment