Commit graph

2880 commits

Author SHA1 Message Date
Kir Kolyshkin
c19e62f87c Change crtools to criu in criu messages
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:20 +04:00
Kir Kolyshkin
00ab805b74 cr-restore.c: fix a typo in a comment
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:08 +04:00
Kir Kolyshkin
644ed099b4 README: crtools to criu rename
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:02:02 +04:00
Kir Kolyshkin
0bc01e798c Documentation/Makefile: fix clean target
...after commit 1e1bf24

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-10 11:01:57 +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
Pavel Tikhomirov
6e5c568a5e timer: use a correct value for dumping usecs
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 13:42:59 +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
Pavel Emelyanov
cd8915202e pagemap: Make show_pagemap use pb_show engine only
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:44:39 +04:00
Pavel Emelyanov
add21b75c9 show: Remove options args from ->show callback
This thing is global, we can address one explicitly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:23:42 +04:00
Pavel Emelyanov
cd537beda5 show: Get rid of flags argument from payload handler
We can "guess" one w/o addirional (obfuscating) argument to
the pb showing engine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-08 00:00:24 +04:00
Cyrill Gorcunov
1d56fe2bf4 files-reg: Use read_fd_link helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:42:59 +04:00
Cyrill Gorcunov
9cdb9102fa util: Make read_fd_link to return the length of the link read
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:42:57 +04:00
Cyrill Gorcunov
e2e4fb1218 files: Use FD_PARMS_INIT in dump_one_file
For consistency sake.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:42:31 +04:00
Cyrill Gorcunov
1ead3d79f7 util: Check for overflow in read_fd_link
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:42:14 +04:00
Alexander Kartashov
a94512dc13 arm: reset the CPSR.T bit when executing the infected code
The infected code must be executed in the ARM mode but the dumpee
may run in the Thumb mode while being dumped so the bit CPSR.T
may be set when the control is transfered to the infected blobs
so this code is executed in the Thumb mode too.

We have to clear the bit CPSR.T before transfering control
to the infected code to prevent the behavior described above.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reported-by: Chanho Park <chanho61.park@samsusng.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:41:02 +04:00
Cyrill Gorcunov
01c9ec6184 tty: Don't try to restore a group on inherited terminal if session leader present
In case if we are migrating a session leader task with a solely
slave peer we should not try to restore a group on the terminal
but rather simply inherit it, because a session of the group of
the inherited terminal is not the same as a session of our leader
thus kernel refuse to set any different group here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:35:33 +04:00
Cyrill Gorcunov
87411d6dfe test: app-emu -- job: Fix comparison and wait for restore complete by a signal
Since we're migrating session leader here, test for session has not
been changed instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:35:32 +04:00
Cyrill Gorcunov
19de6865c4 tty: Use separate tty_info::inherit member to track ttys being borrowed from a parent
This is easier for debugging, the former SID/PGID remains untouched
and printed out in logs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-07 22:35:31 +04:00
Chanho Park
9c5817391d arm: use PTRACE_GETVFPREGS instead of GETFPREGS
If enabled CONFIG_VFP, we should use PTRACE_GETVFPREGS instead of GETFPREGS.
Most of arm hardwares(since then armv6) use VFP. If we need runtime checking of
vfp, we should parse /proc/cpu_info or use any other techniques.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-04 22:07:59 +04:00
Libo Chen
076ad01e4c kerndat: munmap when stat call fail
Avoid memleak in err case

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-04 22:03:08 +04:00
Kir Kolyshkin
befe5ad155 make help: document dist target
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-03 01:56:31 +04:00
Kir Kolyshkin
e516aa0122 Makefiles: add install target
Note to package maintainers:

1 Yes we do support DESTDIR.

2 From packaging scripts, use something like this:

	make install DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr

(v2: add PREFIX, install to /usr/local not /usr by default)
(v3: fix criu man section -- it is 8 not 1)

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-03 01:56:30 +04:00
Libo Chen
ab4338576c cr-check: potential fd leak in check_fdinfo_inotify
Without this patch, ifd will leak when inotify_add_watch fail.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:49:44 +04:00
Libo Chen
61d852e75c cr-check: potential fd leak in check_fdinfo_eventpoll
Without this patch, fd will leak when epoll_create fail!

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:49:43 +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
Cyrill Gorcunov
921dbf23de Don't use \Newline in pr_perror
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:44:24 +04:00
Kir Kolyshkin
4eac6c9e6e criu(8): fix English in examples
1. s/pid 1234/pid of 1234/

2. Remove all those "one should type" or "run".

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:35 +04:00
Kir Kolyshkin
2ebe1db650 criu(8): remove -t from synopsys
Either we list all options in synopsys, or none.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:30 +04:00
Kir Kolyshkin
d33a01482f criu(8): use list for -v arguments
Also, s/options/arguments/.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:22 +04:00
Kir Kolyshkin
229b86a72c criu(8): it's -> it is
A manual page is formal document, not a chitchat, so use of contracted
forms is not appropriate.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:16 +04:00
Kir Kolyshkin
77c3705a49 criu(8): fix a typo
allpies -> applies

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:07 +04:00
Kir Kolyshkin
ec413ac4e0 criu(8): more typesetting fixes.
Literals in bold, variables in italic.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:43:01 +04:00
Kir Kolyshkin
6dc760b614 criu(8): use bold for options, separate by commas
1. Use *bold* for option names.

2. Separate long and short option by a comma and a space.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:42:50 +04:00
Kir Kolyshkin
c4f60cea88 criu(8): move commands out of options, reformat
1. Move commands out of OPTIONS subsection.

2. Don't use bulleted list -- definition list (such as in OPTIONS) is
   better.

Also follwong -> following

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:42:32 +04:00
Kir Kolyshkin
091883513e criu(8): fix typesetting
It's actually not very complicated. Just do this:

1 For literals (verbal text, such as command or option name) use *bold*

2 For substitutions (variable parameter name) use 'italic'

3 Do not use <angle brackets> at all.

Example:

	*-f* 'file'

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:42:14 +04:00
Kir Kolyshkin
1e1bf240e6 criu(1): moved to criu(8)
This command is for root, so section 8 of manual is
more appropriate than 1.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:42:01 +04:00
Kir Kolyshkin
455e1f782e criu(1): change COPYRIGHT section name and years
1 It should be COPYRIGHT not COPYING

2 Happy New Year!

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:40:37 +04:00
Kir Kolyshkin
cfdea52536 criu(1): man page title should be in UPPERCASE
It's a common practice.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:40:30 +04:00
Kir Kolyshkin
7e43957602 Documentation: rename crtools(1) to criu(1)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:38:36 +04:00
Kir Kolyshkin
525da872b2 Makefile: mark gcov target as phony
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:35:36 +04:00
Kir Kolyshkin
fda4562049 Makefile: pass few targets at once
Be green -- save bytes!

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:35:28 +04:00
Kir Kolyshkin
15c3e884fa Makefile: fix whitespace in first $(E) argument
When silent make rules are enabled, we use special format
to inform what is going on, like this

$(E) "  ACTION  " files

We maintain specific whitespace around ACTION so different ones
are aligned nicely. Fix two places that were not aligned to the rest.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:35:01 +04:00
Kir Kolyshkin
c7f22b8daf make help: rename crtools to criu
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:34:39 +04:00