2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

2853 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
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
Kir Kolyshkin
fa291ae858 Makefile: don't use $(E) for help
$(E) is used for 'silent make' to inform about what is going on
when we are not printing actual commands being executed, and do
nothing in case of 'verbose make (i.e. make V=1).

For 'make help' we want to output the text regardless of whether
'silent make' is enabled or not.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:34:33 +04:00
Kir Kolyshkin
d32db87462 Doc/Makefile: mark clean target as phony
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:32:34 +04:00
Kir Kolyshkin
04158bda8f Doc/Makefile: don't build Makefile.build man
This is developers documentation, I doubt any user of crui
is interested in that. So let's not build it by default.

It can still be built manually:

make -C Documentation Makefile.build.1

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:32:27 +04:00
Kir Kolyshkin
b94047e42f Makefile: add tar and dist targets
...using "git archive" command line from Pavel.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:32:21 +04:00
Pavel Emelyanov
9fec380c71 criu: Version 0.5 release
This is lots-of-bug-fixes release -- many new people started playing
with criu and reported a lot of issues with it.

Other than this, we have several new features. First of all it's C/R
of netlink sockets C/R (required for Fedora container dump) and pending
signals.

Next, we've changed the format of memory dumps. This allowed us to
implement so called page server, that allows to send memory dumps
directly on another box w/o intermediate dump file. Also this new
format made it possible to implement the (not yet final) --snapshot
option, that demonstrates the work of user memory changes tracker
in the kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v0.5
2013-04-30 20:50:03 +04:00
Kir Kolyshkin
354f82c3f5 crtools: rename binary to criu
"Tools" in the context of a binary name doesn't make any sense,
because every binary is a tool (lstool, dftool), plus it's one
tool.

So let's rename the beast to criu, which is short, pretty unique
and coincides with the name of the project.

Backward-compatible symlink is added for the sake of tests,
we can fix them later and remove the link.

Packagers beware: our binary is no longer crtools but criu.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 20:17:55 +04:00
Cyrill Gorcunov
3ab9ce3d7f docs: \Tabs to \Spaces
We don't use tabs in docs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 20:14:28 +04:00
Cyrill Gorcunov
60178ffd13 docs: Add --ms option description
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 20:14:22 +04:00
Cyrill Gorcunov
bec67720cc docs: Add page server parameters explanation
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 20:14:15 +04:00
Pavel Emelyanov
5f4759202d tcp: Don't stand absense of TCP_TIMESTAMP sockoption
It has been merged, so do require one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:39:07 +04:00
Pavel Emelyanov
bdf570c9a1 files: Don't dump files whose path doesn't start with /
There are some proc files (ns ones in particular) that are
fake files and on open they screw their path up. Don't dump
them for now.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:33:46 +04:00
Alexander Kartashov
dfaa4542c4 page-xfer: fixed format strings
Use the specifier %lu instead of %zu to print
an unsinged long integer.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:31:36 +04:00
Alexander Kartashov
4d4543f66e page-read: fixed format strings
Use the format specifier PRIx64 instead of %lx to print an off_t integer.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:31:35 +04:00
Alexander Kartashov
cb9094d810 page-pipe: fixed format strings
Use the format specifier %zu instead of %lu to print a size_t integer.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-30 18:31:34 +04:00
Andrey Vagin
15b64d12ca restore: use a correct object core for restoring fpu
tcore (per thread core) should be used here

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 18:40:39 +04:00
Andrey Vagin
4c36be84af restore: change type of blk_sigset on k_rtsigset_t
pie/restorer.c: In function ‘restore_thread_common’:
pie/restorer.c:262:39: error: incompatible types when assigning to type
‘k_rtsigset_t’ from type ‘u64’
   RT_SIGFRAME_UC(sigframe).uc_sigmask = args->blk_sigset;
                                       ^

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 17:54:25 +04:00
Andrey Vagin
83d4ceb89a zdtm: check signal blocking mask in static/sigpending
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:36:05 +04:00
Andrey Vagin
ae729638ef restore: fix restoring signal blocking mask on arm
RT_SIGFRAME_UC(sigframe).uc_sigmask.sig = args->blk_sigset;

blk_sigset is u64, but uc_sigmask.sig has type ulong [2], so
only a part of mask is restore here.

This patch reworks restoring of blocking masks symmetrically to dumping
these masks.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:36:04 +04:00
Andrey Vagin
a724acf571 restore: handle errors of setting credentials (v2)
v2: handle errors from setXids and securebits manipulations
    handle errors of restoring creds after finishing CR_STATE_RESTORE_CREDS,
    because a sigchild handler is already restored in this moment.
    Only the current process is killed in a error case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:32:24 +04:00
Andrew Vagin
495c8007bc zdtm: execite test cases from a test user
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:04 +04:00
Andrey Vagin
42d861bb48 zdtm: check bset in caps00
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:03 +04:00
Andrey Vagin
803321abf6 socket-ext: provide access to socket for a test user
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:15:02 +04:00
Libo Chen
69ca9aff1e cr-check: fix pipe fd leak
fix fdinfo leak.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:11:32 +04:00
Vasily Averin
9c88d0cdd8 proc_parse: double fclose in parse_fdinfo
"crtools check" crashes on ubuntu 12.10
(00.011275) Error (proc_parse.c:1049): No records of type 6 found in fdinfo file
(00.011281) Error (proc_parse.c:1052): parse_fdinfo: error parsing [flags:  02 ] for 6 : Operation not permitted
*** glibc detected *** /home/vvs/devel/criu/crtools/crtools: double free or corruption (top): 0x000000000068a5a0 **

Signed-off-by:  Vasily Averin <vvs@parallels.com>

diff-double-fclose-in-parse_fdinfo
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:10:50 +04:00
Libo Chen
e3101c8eab sk-netlink: fix overflow
break running./crtools check :

*** buffer overflow detected ***: ./crtools terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fdaacb3e82c]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7fdaacb3d700]
./crtools[0x423d00]
./crtools[0x41d021]
./crtools[0x41d259]
./crtools[0x41e4b6]
./crtools[0x418f03]
./crtools[0x404988]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fdaaca5576d]
./crtools[0x404ad9]
======= Memory map: ========
00400000-00463000 r-xp 00000000 08:01 189158                             /home/clb/crtools/crtools
00662000-00663000 r--p 00062000 08:01 189158                             /home/clb/crtools/crtools
00663000-00671000 rw-p 00063000 08:01 189158                             /home/clb/crtools/crtools
00671000-00677000 rw-p 00000000 00:00 0
01801000-01822000 rw-p 00000000 00:00 0                                  [heap]
7fdaac81e000-7fdaac833000 r-xp 00000000 08:01 410533                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdaac833000-7fdaaca32000 ---p 00015000 08:01 410533                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdaaca32000-7fdaaca33000 r--p 00014000 08:01 410533                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdaaca33000-7fdaaca34000 rw-p 00015000 08:01 410533                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdaaca34000-7fdaacbe9000 r-xp 00000000 08:01 393459                     /lib/x86_64-linux-gnu/libc-2.15.so
7fdaacbe9000-7fdaacde8000 ---p 001b5000 08:01 393459                     /lib/x86_64-linux-gnu/libc-2.15.so
7fdaacde8000-7fdaacdec000 r--p 001b4000 08:01 393459                     /lib/x86_64-linux-gnu/libc-2.15.so
7fdaacdec000-7fdaacdee000 rw-p 001b8000 08:01 393459                     /lib/x86_64-linux-gnu/libc-2.15.so
7fdaacdee000-7fdaacdf3000 rw-p 00000000 00:00 0
7fdaacdf3000-7fdaace03000 r-xp 00000000 08:01 937695                     /usr/local/lib/libprotobuf-c.so.0.0.0
7fdaace03000-7fdaad002000 ---p 00010000 08:01 937695                     /usr/local/lib/libprotobuf-c.so.0.0.0
7fdaad002000-7fdaad003000 r--p 0000f000 08:01 937695                     /usr/local/lib/libprotobuf-c.so.0.0.0
7fdaad003000-7fdaad004000 rw-p 00010000 08:01 937695                     /usr/local/lib/libprotobuf-c.so.0.0.0
7fdaad004000-7fdaad01c000 r-xp 00000000 08:01 393528                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7fdaad01c000-7fdaad21b000 ---p 00018000 08:01 393528                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7fdaad21b000-7fdaad21c000 r--p 00017000 08:01 393528                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7fdaad21c000-7fdaad21d000 rw-p 00018000 08:01 393528                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7fdaad21d000-7fdaad221000 rw-p 00000000 00:00 0
7fdaad221000-7fdaad243000 r-xp 00000000 08:01 393441                     /lib/x86_64-linux-gnu/ld-2.15.so
7fdaad437000-7fdaad43b000 rw-p 00000000 00:00 0
7fdaad440000-7fdaad443000 rw-p 00000000 00:00 0
7fdaad443000-7fdaad444000 r--p 00022000 08:01 393441                     /lib/x86_64-linux-gnu/ld-2.15.so
7fdaad444000-7fdaad446000 rw-p 00023000 08:01 393441                     /lib/x86_64-linux-gnu/ld-2.15.so
7fff9eb3c000-7fff9eb5d000 rw-p 00000000 00:00 0                          [stack]
7fff9ebcf000-7fff9ebd1000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

I find this overflow by the phase: memcpy(sd->groups, groups, sd->gsize);
The reason is sd->gsize = 8 Byte, but sd->groups = xmalloc(sizeof(sd->gsize))  is exact 4 Byte.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:09:04 +04:00
Kir Kolyshkin
2cd78c5de7 Makefile: remove --no-print-directory
1 The comment before MAKEFLAGS assignment (see commit 25e8cb5) talks
about -r (and possibly -R) flags and has nothing to do with
--no-print-directory. Let's remove the last option to not confuse
a reader.

2 The --no-print-directory flag to build and build-crtools shorthands
is redundant, because scripts/Makefile.build has it already. Remove.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:06:40 +04:00
Kir Kolyshkin
4e1be049f5 Makefile: remove unused vars
We don't use TAGS, AWK or ECHO anywhere in the code (at least according
to git grep). Let's remove this.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:06:39 +04:00