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>
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>
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>
v2: remove redundant functions and variables.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
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>
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>
-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>
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>
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>
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>
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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>