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

244 Commits

Author SHA1 Message Date
Ruslan Kuprieiev
127637bc49 image: add dir parameter to open_image_dir()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:40 +04:00
Ruslan Kuprieiev
555c8acd4d crtools: add --work-dir(-W) option
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-15 21:38:39 +04:00
Ruslan Kuprieiev
401680e85b crtools: init logfile after processing all command line arguments
I see no need now to init log during processing of command line arguments.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-11 16:03:38 +04:00
Andrey Vagin
4850fd94a8 crtools: move cr_options in a separate header
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-06 18:17:52 +04:00
Ruslan Kuprieiev
fdbedf5a88 crtools: add init_opts()
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-31 20:00:04 +04:00
Cyrill Gorcunov
fa73b3e799 crtools: Use -o argument directly
There is no much point to strdup this value
obtained from command line. It sits in environment
and we don't modify it at all.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-10 11:11:05 +04:00
Cyrill Gorcunov
249ee5f797 crtools: Print error message with capital letter
We usually print error messages starting with capital letter.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-09 17:18:23 +04:00
Pavel Emelyanov
b4c8c5ae32 security: Also save gid of user requesting for C/R
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-28 15:51:09 +04:00
Ruslan Kuprieiev
547d9bf959 v2 security: set suid flag on crtools and check real uid on dump/restore
v2: remove redundant functions and variables.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-10-02 17:11:17 +04:00
Pavel Emelyanov
8708c2d2db help: Add info about --pidfile works for service and page-server
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-24 11:33:36 +04:00
Cyrill Gorcunov
551cd03290 version: Print git id if present
If criu is built from git repo print git commit id, convenient for debug.

For example

 | $ ./criu -V
 | Version: 0.7
 | GitID: 7985251

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 15:01:32 +04:00
Cyrill Gorcunov
5006ed5f7c version: Define version as a macro
Defining it as static char is a bad idea especially
if it get included and never used -- we will get
"unused" variable error.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 15:00:17 +04:00
Andrey Vagin
5aa409afcf crtools: handle -vv..vv propertly
-vv...v must increase logging level on a number of the 'v' symbols.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-14 14:58:23 +04:00
Ruslan Kuprieiev
8fddfd2ff4 crtools: Add cr_service meat
The need in service is described at http://criu.org/Self_dump

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-13 15:53:06 +04:00
Ruslan Kuprieiev
eb79300dfd crtools: initial skeleton for cr_service
The criu service is a daemon, that opens a unix socket and listens for
incoming requests. The requests will be declared in protobuf/rpc.proto
and for now will only contain the 'dump' request.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-13 15:50:39 +04:00
Pavel Emelyanov
7f9302505c page-server: Convert opts.addr into char *
We'll have --address argument reused for library, so make this
abstract address, not ipv4 one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-11 12:01:14 +04:00
Pavel Emelyanov
1480708900 crtools: Fix -v option to conform to common sense
The -v option is declared as "optional argument" and thus
only -v=N or -vN are valid. Currently used -v N syntax no
longer works as expected, this will be treated as LOG_ERR
level (single -v) with dangling (unparsed) argument.

Sorry for that :( but it's better to this earlier.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-11 20:12:03 +04:00
Pavel Emelyanov
6bf22f8c75 crtools: Get rid of on-stack cr_options
We have global instance of them, that's enough.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-28 21:11:13 +04:00
Andrey Vagin
b2846be8c3 page-server: introduce the --daemon long option
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-20 19:11:19 +04:00
Andrey Vagin
4f1d2a1005 page-server: allow to execute page-server in the background (v2)
page-server creates a listen socket and only then goes into the
background, so we can be sure, that page-server is ready for work after
detaching.

v2: call daemon() in a proper place and reuse the option -d

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-20 15:00:40 +04:00
Pavel Emelyanov
94722c2e35 help: Add message about "unknown command"
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:42:51 +04:00
Pavel Emelyanov
b7639611f7 help: Add \n after page-server line in synopsis
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:42:08 +04:00
Pavel Emelyanov
605f31d704 help: Move --page-server option in help text
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 14:41:43 +04:00
Kir Kolyshkin
ef5ef1078c criu --help: add pre-dump to synopsys
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:50 +04:00
Kir Kolyshkin
321de44986 criu --help: fix -D description
-D is used for dump and restore, i.e. to read and write image files,
depending on the command, so let's put a read/write-neutral description.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:17 +04:00
Kir Kolyshkin
f0cbd3e193 criu --help: PID is not used for restore command
A couple of fixes related to the fact.

This is an addition to commit 43ce038

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:53:07 +04:00
Kir Kolyshkin
2785c8bbd2 criu --help: add page-server command to synopsys
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:52:50 +04:00
Kir Kolyshkin
b13494b9fc criu --help: don't use argv[0], print help in one call
This patch

1. Replaces using argv[0] with criu literal. Using argv[0] is bad
because it can be a relative path, and it can be not "criu" but
say a symlink pointing to criu.

2. Reformats the source to print basic help test in justone call to
pr_msg(), same as commit 6ea0e00 did for extended help, for same
reasons: having it this way is easier to do further edits.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 00:52:40 +04:00
Pavel Emelyanov
d71d17c983 help: Document memory snapshotting options
Now they seem to look OK.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:11:51 +04:00
Pavel Emelyanov
a533820b7e dump: Introduce the pre-dump action
With this action criu will seize tasks, grab all its memory into
page-pipes, rest dirty tracker and will then release them. Writing
the memory from page-pipes would occur after tasks are unfreezed
and thus the frozen time should become reasonably small.

When pre-dump is in action, the dirty tracking is forcedly turned
off as well as tasks are resumed afterwards, not killed, by default.

This is a prerequisite for iterative migration.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 12:00:40 +04:00
Pavel Emelyanov
d416e6a135 mem-snap: Redefine CLI options for mem snapshot
They are not documented, thus OK for now. Two options --
* one to specify where the parent images are
* one to reset dirty memory tracking

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-14 11:04:57 +04:00
Pavel Emelyanov
d7e547dfb7 cr: Remove opts argument from cr_dump_tasks
Options are collected in global variable, no need to have them on stack.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-13 14:08:55 +04:00
Pavel Emelyanov
55c8f3cc7f crtools: Sanitize "action" (argv[1]) parsing
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 14:23:22 +04:00
Kir Kolyshkin
43ce038e6e criu dump: don't require -t
and warn if it is used.

v2: fix help text as well

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 13:41:42 +04:00
Kir Kolyshkin
8f6d82288c criu --help: reformat -v description
Let's save 4 lines of output and put -vvv at the same line as -v 3.

Also, -v argument is in fact option, so mark it as such: [NUM]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:15 +04:00
Kir Kolyshkin
02bcb974a1 criu --help: fit to 80 columns
From where I stand, any help output that exceeds 80 columns is hardly
readable, so let's try to fit into that.

Apparently in many cases we can do that by removing some extra info
which, I guess, belongs to documentation or wiki but not to --help
output which should be just a short reference.

For this reason, this patch also removes information about environmental
variable set for external scripts -- such documentation does not belong
here.

Please review carefully to make sure I haven't thrown the baby out
with the bathwater.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:14 +04:00
Kir Kolyshkin
dd49705b4e criu --help: minor cleanups
1. "written in file" -> "written to file"

2. "relative path is relative" -> "path is relative"

3. "each restored processes is written to the FILE.pid file\n" ->
   "log of each restored process is written to a separate FILE.pid file"

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:48:13 +04:00
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