2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 12:57:57 +00:00

157 Commits

Author SHA1 Message Date
Kir Kolyshkin
ce3f7e48ee crtools --help: add --ms option to check syntax
Alternatively, we could add [<options>] but since this is the only
option let's just add this one.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:12 +04:00
Kir Kolyshkin
eeb5d9701c criu --help: be consistent in argument notation
1. Now either <arg> or ARG or [ARG] were used to denote an option
argument. Let's be consistent and use ARG everywhere. An alternative
could be be <arg>, but I'm strongly against [ARG] since square brackets
traditionally denote something that is optional.

2. If argument is a file name, use FILE, not NAME or SRC

3. For options that require argument, add argument. List includes:
	-t|--tree
	-D|--images-dir (twice)
	-f|--file
   Maybe I missed something else, hopefully not.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:11 +04:00
Kir Kolyshkin
e553cff844 criu --help: do not use tabs
Some lines were using tabs, some were not. Personally I am not in favor
of any style, but let's be consistent in either using tabs or not.

Changing tabs with spaces produced a smaller patch, so let's do this
way.

This patch should not produce any visual change in output.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:10 +04:00
Kir Kolyshkin
6ea0e00222 criu --help: print extended help in one call
This patch reformats the source to print extended help using just one
pr_msg command. Having it this way is easier to do further edits.

I have checked ./criu --help output before and after to make sure it's
the same.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:09 +04:00
Kir Kolyshkin
abe3c594de Fix CRTOOLS_SCRIPT_ACTION name
... in quite a few places.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:07 +04:00
Pavel Emelyanov
379abca968 check: Introduce --ms option
This option skips checking for features, that are known to
be absent in mainstream kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-23 23:38:47 +04:00
Pavel Emelyanov
c2c8d81d48 cr: Remove --snapshot from help text
It's not complete and is about to change significantly. Better not
show it oficially.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-18 16:30:41 +04:00
Pavel Emelyanov
dcba149125 crtools: Put short options near long options
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 11:43:55 +04:00
Pavel Emelyanov
571967ca02 crtools: Tune --help test
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-16 11:40:56 +04:00
Kir Kolyshkin
d90d4b1b88 Fix typos in log messages
Someone has to do it, right?..

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 12:46:25 +04:00
Pavel Emelyanov
60fc6abfd7 cr: Preparations for snapshot
1. Directory with images may have a "parent" symlink pointing to the
   place where the previous snapshot is
2. Each pagemap will have "in_parent" bit, which means, that the
   pages for this pagemap entry are not in the respective page.img
   but in parent
3. New --leave-running option to use with --snapshot not to kill
   tasks after snapshot

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-12 19:45:15 +04:00
Pavel Emelyanov
73d7e283a7 show: Filter -D output with --pid option
Show only image info relevant to given pid. Also reuse
the introduced --pid argument for exec action.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-02 11:58:15 +04:00
Pavel Emelyanov
87d0d61e41 lock: Show long option in log message about using one
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 20:17:59 +04:00
Pavel Emelyanov
25ef419982 tty: More descriptive log message about --shell-job requirement
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-27 20:11:00 +04:00
Pavel Emelyanov
21cf5d2e4c help: Sanitize special resources options
* remove obsoleted --namespaces
* use macro for ext socket option name in help text

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-26 22:18:16 +04:00
Pavel Emelyanov
f52d53c585 unix: Make more descriptive error logging for ext socket restore failure
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-26 19:32:53 +04:00
Pavel Emelyanov
213faeae6d mem: Introduce page server
The page server is a process, that is about to get pages over
the network and put them into pagemap- + pages- images. Right
now what it does is simply get the data and puts it into the
image files. When we have dirty set tracking in the kernel the
page server will have to collect "page changes" and properly
integrate them into images.

Running crtools with page server is like this:

dst_node# crtools page-server --port <port> -D dump/ ...
src_node# crtools dump -t <pid> --page-server --address <dst_node> --port <port> -D dump/ ...

After this images from dst_node/dump/ and src_node/dump/ should
be put into one place and tasks can be restored out of it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-14 18:16:44 +04:00
Cyrill Gorcunov
90fbbabb34 make: Generate crtools version from Makefile definition
This allows us to have a unique place where version lives
and what is more important other subsystems (such as docs
generation) may reuse version definitions.

At moment EXTRA (which corresponds kernels -rc tag) and
NAME is not yet used, but I desided to put them in place
for future needs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-11 19:24:06 +04:00
Andrey Vagin
749116b49e crtools: fix the name of --file-locks in the help message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-21 17:39:26 +04:00
Pavel Emelyanov
ac845bd1d8 cr: Obsolete the --namespaces option
It's no longer required to use this option -- two currently
supported cases (tasks on host and tasks in containers) can
be detected automatically. Keep this option for future.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-18 13:25:16 +04:00
Qiang Huang
8f96ff85ff crtools: Add --file-locks option
Add --file-locks/-l option to support handling file locks, for safety,
only used for container.

Originally-signed-off-by: Zheng Gu <cengku.gu@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-17 14:36:47 +04:00
Alexander Kartashov
6f61488f21 x86: moved x86-specific files into the directory arch/x86.
* The following files goes into the directory arch/x86/include/asm unmodified:
  - include/atomic.h,
  - include/linkage.h,
  - include/memcpy_64.h,
  - include/types.h,
  - include/bitops.h,
  - pie/parasite-head-x86-64.S,
  - include/processor-flags.h,
  - include/syscall-x86-64.def.

* Changed include directives in the source files that include the headers
  listed above.

* Modified build scripts to reflect the source moves.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-09 17:02:47 +04:00
Pavel Emelyanov
4bb4ece76e exec: Initial skeleton
Reserve the cmdline option for this and link empty file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-17 22:56:06 +03:00
Pavel Emelyanov
d7259d863f help: Print shorter help when lanuched w/o arguments
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-17 22:39:10 +03:00
Huang Qiang
1e93a46e9b crtools: update the usage message for log level
We have more than 2 levels right now, update the usage message.

Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 13:45:25 +04:00
Huang Qiang
0c23c5835e crtools: fix a bug that log_level may not work
If we use -v [num] to set log_level and we happen to set it in the end of
arguments, the [num] we set may not work. This patch will fix it.

Signed-off-by: Huang Qiang <h.huangqiang@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 13:44:26 +04:00
Cyrill Gorcunov
6a9fecb5ea crtools: Add missing \n in pr_err
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-01 15:28:37 +04:00
Cyrill Gorcunov
9ba5c935f1 options: Add "--shell-job" option
This option will tells the tool to procceed dumping
even if a root task is not a session leader.

This implies that this option will allow to "migrate"
one external tty connection. Say a person may dump
"top" application in one bash shell and restore it
in another shell session.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-10-18 15:51:57 +04:00
Pavel Emelyanov
4797f7236e help: Add newline at the end of action scripts help messages
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-26 20:11:54 +04:00
Pavel Emelyanov
1be08acc7c remap: Add cmdline option to allow linked remap
By default crtools shouldn't modify the environment, except for
killing the dumped tasks. The link remap does so and should sit
under explicit cmdline option.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-26 06:39:23 +04:00
Andrey Vagin
4c2a226458 crtools: add ability to execute external scripts (v2)
Scripts are executed when external actions required.
CRTOOLS_SCRIPT_ACTION contains a required action.
If a script doesn't know a current action, it should exit with 0.

The first usecase will be lock/unlock network.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-17 20:05:23 +04:00
Cyrill Gorcunov
45cc85eea4 Speed up service-fd retrieval
We're using get_service_fd in file engine,
better to make it fast. This patch caches
the limits system provides us, instead of
calling getrlimit() every time.

This patch introduces is_service_fd helper
which will be used instead of get_service_fd
where it make sense.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-13 14:45:06 +04:00
Andrey Vagin
ae70bc0ad6 net: add ability to set names for outside links of veth devices
When restoring a container crtools create veth pair inside it and then
pushed one end to the namespaces crtools live in (outside). To facilitate
the subsequent management of the otter end of the veth pair this option
is added -- one can specifu a name by which the respective end would be
visible. E.g.: --veth-pair eth0=veth101.0

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-02 01:07:32 +04:00
Andrey Vagin
aabb56bd66 crtools: write a pid of a root task in a specified file
When we restore a pid namespace the root task will get some unknown pid
in the original (i.e. -- the ns crtools a launched from) one. To find
this pid out one can use this option -- it will make the pid obtained by
the new init to be written into a pid file.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-14 12:54:00 +04:00
Andrey Vagin
ba0d5fb226 dump: handle overmounted devices (v2)
"init" in LXC opens /dev/null and then mounts devtmpfs in /dev,
so crtools can not resolve the path to the origin /dev/null.

crtools with the option --evasive-devices will check the origin
device and a new device are the same and if it's true, crtools will
dump a new path.

v2: add a description for the option

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:33:49 +04:00
Pavel Emelyanov
9e84bd1083 pb: Introduce pb message types and cr-descriptors
The protobuf-c generate plain routines for entries manipulations, but
we want to have some "generic" way of working with messages. Collect them
all in an array of descriptors (similar to image files descriptions) and
do full typechecking while this.

Such thing will allow to simplfy code later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:21:58 +04:00
Cyrill Gorcunov
25b35f13b6 help: Add mnt and net options into the list
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-06 18:29:53 +04:00
Andrey Vagin
420325dca6 restore: add an option for changing a root file system (v2)
The option is -r|--pivot-root and an argument is a path to new root.
A root task will make pivot_root. LXC CT does that, so we need that
for restoring.

v2: s/pivot-root/root/

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 16:07:43 +04:00
Pavel Emelyanov
0a827aa96c net: Basic netns dump/restore skeleton
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 08:06:29 +04:00
Kinsbursky Stanislav
6243e9c0cb crtools: remove references to absent '-p' option
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:09:52 +04:00
Kinsbursky Stanislav
2249fb3c91 crtools: check optind is valid before parsing command argument
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:08:46 +04:00
Cyrill Gorcunov
f34cd5fd94 help: Drop -p option
We don't have it anymore

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-23 07:09:22 +04:00
Pavel Emelyanov
64967eef21 crtools: Kill the ability to work on individual process
We haven't tested it for several monthes and there's no evidence
it is required at all. For dumping a single task -t option works
just fine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 17:55:34 +04:00
Pavel Emelyanov
76e7f12cb8 log: Fix loglevel assignment
For some reason the optind was misused (maybe I broke it with prev patch)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 17:25:04 +04:00
Pavel Emelyanov
0b76ba375e crtools: Add version constans and cmdline option
Set it to 0.0 since we haven't done any releases yet.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 16:51:58 +04:00
Pavel Emelyanov
dd16fec48c crtools: Sanitize options parsing
Do not presume that the argv[1] is action. Use the optind index at the end
of parsing instead. This allows to specify --help option properly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 16:50:04 +04:00
Pavel Emelyanov
2c978d84d3 crtools: Celan crtools.c from unneeded headers
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-28 03:15:01 +04:00
Pavel Emelyanov
611b97248b img: Move all the img files management code to image.c
And clean util.c and crtools.c from image manupulation code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-28 03:12:08 +04:00
Andrey Vagin
9b3b059bdc crtools: add "pid" to the --namespaces cmdline option arguments (v3)
to require dumping pid namespace. Dump and restore will be failed if
a tress doesn't contain a process init.

pid namespace will be created implicitly if a process init in the tree.

v2: fix comments from Pavel
v3: Restore of pidns should be approved by user

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-22 12:08:57 +04:00
Pavel Emelyanov
db297a0f97 mnt: Preparations for mountpoints dumping
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 03:30:10 +04:00