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

3125 Commits

Author SHA1 Message Date
Pavel Emelyanov
5762076dbb dump: Factor out thread_core dumping
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 16:09:23 +04:00
Pavel Emelyanov
a04ccc22a0 dump: Remove unused arg from dump_task_core_all
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 16:06:08 +04:00
Pavel Emelyanov
ae25daf007 dump: Move dump_task_mm out of dump_task_core
Mm used to be in code, so the call was left in that place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 16:05:29 +04:00
Alexander Kartashov
adac35445a arm: moved the mincore syscall description
The description of the syscall mincore breaks
the traditional ordering of syscall descriptions.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 15:57:32 +04:00
Alexander Kartashov
d305fb1306 arm: refactor the syscall glue to support ARMv6
This patch modifies the ARM syscall glue as follows:

* the macros syscallX that produce different code
  for syscalls with different number of arguments
  are replaced by the generic syscall thunk copied
  from libc;

* the syscall tables generation script is simplified
  since the syscall argument number analysis is redundant;

* the ARMv7 specific instruction MOVW is eliminated.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 15:57:26 +04:00
Alexander Kartashov
6ee9ad5bc4 arm: added the ARMv6 data barrier implementation
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 15:57:06 +04:00
Alexander Kartashov
3a94986310 cr: determine the version of the ARM architecture of the target machine
This patch modifies the build system to analyze the version
of the target ARM architecture and setup the compiler flags
accordingly. This makes it possible to support the ARM
architectures prior to ARMv7.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-10 15:56:57 +04:00
Andrey Vagin
5eb254b016 tmpfs: use the --one-file-system option for dumping tmpfs with help tar
Actully for dumping tmpfs it should be remounted to somewhere else to
avoid overmounts.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:33:33 +04:00
Cyrill Gorcunov
e7b656190e headers: Beautify sigframe.h
- include "protobuf/core.pb-c.h" for CoreEntry definition
- gather structure predeclaration on top
- move general comment on top as well
- add extern for construct_sigframe helper

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:16:24 +04:00
Cyrill Gorcunov
f53be5b0d9 syscalls -- Add sys_sigaltstack
Will need it to retrieve signal stack parameters.
Note for simplicty I declared the syscall having
void * arguments, while libc has it as stack_t *.
This need to be cleaned up one day (because
we use similar structure for sigframe definition
and need to merge both definitions down).

ARM syscall def from alekskartashov@

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:14:39 +04:00
Cyrill Gorcunov
39cadf5b66 pstree: Move thread_core allocation to generic routine
It's not arch dependent by any means, thus it looks
strange that we allocate it in arch/ but free in
pstree.c.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:14:11 +04:00
Cyrill Gorcunov
085747fb0b arm: Fix memory alloc/frees for core entry, v2
- return -1 on error
- assign allocated entries immediately
- test for fpstate allocated on free path

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:13:29 +04:00
Cyrill Gorcunov
cdfe2bdd68 x86: Sanitize arch_alloc_thread_info
- We have a convention to return -1 on error
- Drop empty line

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 20:12:57 +04:00
Yicheng Qin
79989de5a3 always set scheduler and priority in restore to ensure correctness
Make criu still set scheduler and priority on restored process even
when its setting is the default one. Or if criu itself has special
setting on it, forked processes will inherit it, which is a wrong setting
for restored ones.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 13:52:58 +04:00
Pavel Emelyanov
34f4e2d05c rst: Compile fix for rst mem API usage in rlims
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 13:48:59 +04:00
Cyrill Gorcunov
73a8b996c5 restorer: Use rst memory allocator for rlimits restore
Number of rlimits may vary depending on system version
criu is compiled against. So we use rst-allocator to
carry all limits read from file.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-09 00:21:31 +04:00
Pavel Emelyanov
bd58fce18f core: Sanitize check_core return evaluation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 19:10:11 +04:00
Pavel Emelyanov
1133ed73bd rst: Create rst-mem pages _after_ local smaps parse
This memory is unmapped by handr, so no need in polluting
self-smaps with it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 16:39:43 +04:00
Pavel Emelyanov
402707107f rst: Simplify before/after remap API
Actually after remap the rst-mem is still visible in the crtools,
although at another address.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 16:27:03 +04:00
Pavel Emelyanov
2652962bd4 rst: Unmap restorer dyn-args memory at the end
Reported-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 16:22:51 +04:00
Pavel Emelyanov
79dfbe6cc2 tcp: Switch to use rst memory allocator on repair off
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 15:04:57 +04:00
Pavel Emelyanov
e458d20c4d siginfos: Switch to use rst memory allocator
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 15:02:46 +04:00
Pavel Emelyanov
4171d5bf58 posix-timers: Switch to use rst memory allocator
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 15:00:08 +04:00
Pavel Emelyanov
df51773b06 rst: Introduce memory allocator for rst blob
The memory in question is allocated and then remaped into
restorer with one call to mremap. Thus, to use the mem we
need to provide to users API for

* alloc memory
* get current allocation pointer
* convert current pointer into remapped one
* the remap itself

This would help combinding lots of small allocations such
as tcp sockets to unrepair, siginfos and posix timers.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-05 14:56:45 +04:00
Andrey Vagin
0e0a398959 proc: fix memory leak
timer is not freed in case of eof.

CID 1042301 (#1 of 1): Resource leak (RESOURCE_LEAK)
15. leaked_storage: Variable timer going out of scope leaks the storage it points to.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 13:40:23 +04:00
Andrey Vagin
071b940a7e files: don't compare unsigned value against 0
CID 1042292 (#1 of 1): Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned value is
never true. "len < 0UL"

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 13:40:18 +04:00
Andrey Vagin
55fe093908 zdtm: don't destruct an external mount-namespace
Before doing something with mounts they should be marked as private,
otherwise our actions can affects someone else.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 13:39:22 +04:00
Andrey Vagin
7aaef1ee4f mount: don't destruct an external mount-namespace (v2)
If a parent mount point is shared with exteranl mntns, a child will be
umounted from the external mntns too.

For example:
$ mount -t tmpfs xxx /root/tmp/
$ mount --make-shared tmp
$ mkdir tmp/xxx
$ mount -t tmpfs xxx /root/tmp/xxx
$ touch tmp/xxx/a

$ unshare -m umount tmp/xxx
$ ls -l tmp/xxx/a
ls: cannot access tmp/xxx/a: No such file or directory

This patch changes a parent mnt to private for umounting childrens.

v2: exit if a mount point can not be marked ad private

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-08 13:39:16 +04:00
Pavel Emelyanov
714443d96f netlink: Lower netlink error report log level
This most likely meand, that the respective -diag module is missing.
In that case the caller would check it and _might_ not fail the dump
at once. Thus treat it as error.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-04 15:49:02 +04:00
Pavel Emelyanov
52de6313a8 kerndat: Sanitize pagemap entry read err check
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:52:22 +04:00
Pavel Emelyanov
0b5170c0fc mem: Remove pagemap2 mentions
This file was created for backward compatibility with
not-yet-patched kernel. Now we can remove it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:51:33 +04:00
Andrey Vagin
8bbf64ebfa posix-timer: make parser a bit more readable
Cc: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-03 13:36:08 +04:00
Pavel Emelyanov
0f96026192 mem: Lower messages severity for inability to reset dirty tracker
The _actual_ need for this is checked in other place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 09:15:50 +04:00
Andrey Vagin
f70859e2fc posix-timers: don't call ferror for NULL
parse_posix_timers should not call ferror if fopen returned NULL.

Reported-by: Adrian Reber <adrian@lisas.de>
Cc: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 20:25:14 +04:00
Pavel Emelyanov
c8f3e09f17 zdtm: Add test for semi-closed unix connection
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 02:30:14 +04:00
Pavel Emelyanov
1148edc1a6 unix: Support semi-closed stream connection
Unix socket and have no peer, but be in established state.
Such types of sockets appear when one end of a connection
closes and leaves the peer in full-shutdown state.

Check this and handle properly on restore.

Reported-by: Florian Gross <Florian.S.Gross@web.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 02:28:43 +04:00
Alexander Kartashov
e38617258b arm: added ARM versions of the POSIX timer syscalls
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-02 17:19:52 +04:00
Pavel Emelyanov
1845284009 criu: Version 0.6 release
This release goes on increasing the bugfix-to-features
ratio. Though we still have a lot of new stuff in the tool
the amount of bugs we've caught and fixed increases.

As a very notable feature it's worth mentioning that we
have prepared crtools to be ready to restore images,
converted from those generated by rh6-openvz kernel, i.e.
we are very close to have live-migration from rh6 to
whatever-it-will-be as the next openvz kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v0.6
2013-07-01 21:31:05 +04:00
Pavel Emelyanov
1edb5b01f3 mem: Don't ignore memory tracking reset errors
Otherwise on non-soft-dirty kernel dump passes, but
produces broken image.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 21:26:35 +04:00
Pavel Emelyanov
2030f2dfb1 timers: Unmap posix timers info mem after restoring them
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 20:11:22 +04:00
Pavel Emelyanov
f8464fdafe timers: Split posix timers restore into two stages
1st stage is -- creating the timers. It may fail if kernel
allocated IDs in a manner we don't expect or runs out of
memory.

2nd stage is -- arm the timers. It cannot fail, since we've
validated the timespecs in advance and should happen after
we've waited for all the other tasks to complete the restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 20:02:15 +04:00
Cyrill Gorcunov
b62df5c986 test: app-emu -- Fix typo in command line
$pid variable get chopped by editor

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 19:39:45 +04:00
Cyrill Gorcunov
47faeca62c test: app-emu -- Use new -v syntax
We've slightly updated -v option argument parsing,
thus update cmdline used in a few app-emu tests.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 19:31:09 +04:00
Andrey Vagin
1b2c3e699b zdtm: don't take into account cpt/rst time in posix_timer
Add cpt/rst timeout to inaccuracy.

All timers are stopped during cpt/rst. We don't know in which moment
they are stopped and run, so this timeout is added to acceptable
inaccuracy.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 18:41:02 +04:00
Andrey Vagin
553c0480c4 parasite: minor clean up
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 18:27:41 +04:00
Pavel Emelyanov
ca6c026a31 check: Netlink diag and peek-siginfo is in 3.10 already
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 18:24:24 +04:00
Cyrill Gorcunov
00be48d575 files-reg: Show ghost file name on error
| Can't open ghost file /tmp/file_aio.cRgOVJ.cr.169.ghost: File exists

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:39:01 +04:00
Cyrill Gorcunov
781cf5d31b zdtm: maps00 -- Add more detailed output
For easier detection where exactly test fails.

| 665: map: ptr 0x7fa96bbe4000 flag        2 prot        0
| 665: map: ptr 0x7fa96bbe2000 flag        1 prot        0
| 665: map: ptr 0x7fa96bbe0000 flag       22 prot        0
| 665: map: ptr 0x7fa96bbdb000 flag       21 prot        0
...
| 665: Read: 0, Expected: 553e7b06
| 665: Read: 0, Expected: 553e7b06
| 665: Read: 0, Expected: 553e7b06
| 665: FAIL: maps00.c:145: CRC mismatch: ptr 0x7fa96bbcb000 flag 21 prot        3

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:38:29 +04:00
Pavel Emelyanov
55b51d8f74 zdtm: Wire posix-timers test in
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:26:48 +04:00
Pavel Emelyanov
db77402ae0 proc: Use open_proc helper to open timers file
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:26:30 +04:00