2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-02 07:15:31 +00:00
Commit Graph

3077 Commits

Author SHA1 Message Date
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
Pavel Emelyanov
1f5acc0242 check: Check that /proc/PID/timers file is here
It's required to get support for posix cpu timers and
it has appeared in v3.10

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:23:51 +04:00
Pavel Tikhomirov
162866feee posix-timer: Add macros to exclude periodic
Explanation of exclude periodic test is that we can't set overrun for
timer, so all checks will fail in case of big overrun before dump.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:37 +04:00
Pavel Tikhomirov
f8bb9c3653 posix-timer: Add test non consequent timer ids
Add fake timers to inshure that then timer ids don't go one after
another c/r go well.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:36 +04:00
Pavel Tikhomirov
b782b982bd posix-timer: Restore timers, need create and delete 'fake' timers
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:34 +04:00
Pavel Tikhomirov
5c8db84fa2 posix-timer: Add reading image and put it to shared memory
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:32 +04:00
Pavel Tikhomirov
2940109a24 posix-timer: Restore and fix one timer
This also add function to check if time represented by two numbers is
valid. I.e. for timespec(sec, nsec), sec and nsec must be > 0 and nsec
must be less when NSEC_PER_SEC.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:31 +04:00
Pavel Tikhomirov
d8be68f3d1 posix-timer: Add restore structures
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:30 +04:00
Pavel Tikhomirov
9a9424ee10 posix-timer: Add dump functionality
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:28 +04:00
Pavel Tikhomirov
335a158ebc posix-timer: Get info in parasite, and structures
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:27 +04:00
Pavel Tikhomirov
d992960fa7 posix-timer: Parse proc /proc/<pid>/timers and save info in list
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:26 +04:00
Pavel Tikhomirov
2752cf9bf7 posix-timer: Add fd, magic and show functionality.
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:24 +04:00
Pavel Tikhomirov
2f98253c26 posix-timer: Add protobuf message and rename to protobuf/timer.proto
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:23 +04:00
Pavel Tikhomirov
652ce02eeb syscalls: Add proper syscalls definition.
Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:19:21 +04:00
Andrey Vagin
dd38ae16d1 mm: handle new processes which created between snapshots (v2)
These processes don't have image files in a parent snapshot and crtools
should not fail in this case.

https://bugzilla.openvz.org/show_bug.cgi?id=2636

v2: return NULL from mem_snap_init, if a parent image is absent.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-27 23:47:15 +04:00
Andrey Vagin
538e87ca92 zdtm: add a new test case, which create processes in a loop
and this processes live a short period of time. This test case is needed
for testing snapshots.

https://bugzilla.openvz.org/show_bug.cgi?id=2636
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-27 23:46:54 +04:00
Andrey Vagin
ce988e44fb zdtm.sh: check snapshot functionality
Only last iteration stops processes, all other iterations make
snapshots. Processes are restored from the last snapshot.

bash -x test/zdtm.sh -s -i 3

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:22:57 +04:00
Andrey Vagin
13a809a9fa zdtm.sh: fix indentations
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:22:36 +04:00
Alexander Kartashov
5bf83eaf69 mem: don't screen page dump failure
This patch prevents page dump failure screening
by the PARASITE_CMD_MPROTECT_VMAS command success.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:17:28 +04:00
Alexander Kartashov
1ef1c80f3d arm: bitops: fixed bitops to access more than 32 bits
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:16:43 +04:00
Andrey Vagin
c97911a5f2 mm: initialize PageEntry pe to NULL in PagemapEntry
Otherwise it contains trash and BUG at page-read.c:98 may be triggered.

https://bugzilla.openvz.org/show_bug.cgi?id=2633

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:15:27 +04:00
Andrey Vagin
93884266ef ptrace: check that process is stopped by SIGTRAP
All other states are unexpected.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:14:42 +04:00
Andrey Vagin
b43c29bbb4 parasite: unprotect VMA-s if one of DUMPPAGES operations failed
PARASITE_CMD_DUMPPAGES is called many times and the parasite args
contains an array with vmas at this time, so VMAs can be unprotected in
error case

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-22 13:13:11 +04:00
Pavel Emelyanov
d020ebb36d files: Compact the code by removing per-file dump helpers
Since *all* of them just call do_dump_gen_file with proper ops,
just call one directly. Compacts the code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 00:11:08 +04:00
Andrey Vagin
42f77676b6 parasite: wait a specific pid
This code was written, when all threads were daemonized.
Now only a thread leader is daemonized.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:19 +04:00
Andrey Vagin
799182a16a parasite: wait sigreturn only if task is in parasite code
For some reasons a task can go out from a parasite code.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:18 +04:00
Andrey Vagin
557f59351c parasite: close control socket on finalization stage
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:17 +04:00
Andrey Vagin
a45f07e27a parasite: handle errors of PTRACE_INTERRUPT
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:16 +04:00
Andrey Vagin
842dbf6e09 parasite: exit from parasite code if something failed
The controll socket is shut down for only writing, because it will wait
FINI command.

https://bugzilla.openvz.org/show_bug.cgi?id=2622

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:14 +04:00
Andrey Vagin
cb9574a361 syscall: add shutdown
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:13 +04:00
Andrey Vagin
252273ff4b parasite: fix error code in __parasite_daemon_wait_msg
A negative value must be resturned in error case

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:12 +04:00
Andrey Vagin
befefb70dc parasite: fix error code of parasite_get_proc_fd
ret contains a successful code of readlink

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-14 15:22:10 +04:00
Cyrill Gorcunov
07283b3781 vdso: Diet include/vdso.h
In commit 2f5df09da5
we included asm/type.h for bool definition. This
is fine in terms of CRIU but makes cpt2 converter
to carry the whole asm/type.h, sometimes causing
error due to confilicting definitions.

So lets be simplier and include <stdbool.h> instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-13 19:41:09 +04:00
Cyrill Gorcunov
8feb155d91 files: ghost -- Make sure we never have ghost bit in id
Just to protect ourself from unpredicted changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-13 19:40:43 +04:00
Chanho Park
61ce81b0e5 pie: log: parse %llx argument correctly
A x64 only converts PRIx64 to %lx. However, ARM will convert it to %llx.
Thus, we have to peek one more character and skip it if next is 'l'.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-13 19:40:11 +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
40ed18839e net: Print link kind when reporting inability to dump such
Kernel has more and more links with rtnl-ops, which report
a string kind of the device, which is handy for debugging.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-11 16:49:11 +04:00
Chanho Park
d3b122fbc0 Makefile: Add LDFLAGS directive
This patch adds LDFLAGS directive to build with -static.
You can build in static mode like below:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi LDFLAGS=-static

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-11 11:02:42 +04:00
Chanho Park
be2020f26c pie: always build in arm mode
Parasite blobs should be compiled in arm mode.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-11 11:02:25 +04:00
Chanho Park
d47434abf8 pie: use 'unsigned long' instead u64
Sys_mmap returns 'unsigned long' value. Contrary to x64, ARM has 32bit size of
'unsigned long'. If sys_mmap returns 32bit value, higher 32bit will be filled
0xffffffff.

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-06-11 11:01:31 +04:00
Pavel Emelyanov
88524cf5af exec: Add support for return-arguments
Reminder: the '&<string>' arg turns out into an address in memory
containing <string>. The '@<size>' arg turns out into an address
to uninitilized memory of size <size>, which contents it printed
after syscall returns.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-08 00:37:05 +04:00
Andrey Vagin
b4cebc4f2d parasite: remove an unused id field from parasite_dump_thread
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-08 00:01:48 +04:00
Cyrill Gorcunov
38dd47b524 mount: Verify for external shared mount
If we meet shared mount point without share master belonging
to us -- it means we might fail on restore, thus require both
master/slave mount peers to be collected on dump.

In other words, the output will be like

 | (00.077025) Error (mount.c:421): Mount 49 (master_id: 2 shared_id: 0) has unreachable sharing
 | (00.077123) Error (mount.c:472): Can't proceed 4237's mountinfo
 | (00.077865) Error (namespaces.c:442): Namespaces dumping finished with error 65280

https://bugzilla.openvz.org/show_bug.cgi?id=2608

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-08 00:00:59 +04:00
Cyrill Gorcunov
e9b00f9918 mount: Simplify mnt_entry_alloc
Allocate it with xzalloc instead of massive
NULL assignment. Moreover, don't forget to
initialize @siblings.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-08 00:00:27 +04:00
Cyrill Gorcunov
afd4b007b4 zdtm.sh: Rename crtools to criu
The jenkins framework might need some lifting up
(crtools.$commit changed to criu.$commit).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:59:45 +04:00
Cyrill Gorcunov
af474de609 Drop crtools word from zdmt C code
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:58:43 +04:00
Cyrill Gorcunov
3c6180ac0b Use criu instead of crtools in test scripts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-03 13:58:05 +04:00
Alexander Kartashov
f7b9f0a2d7 zdtm: added a test validating ARM NEON checkpoint/restore
This patch adds the test static/arm-neon00 modelled
after the test static/fpu00: it initializes ARM NEON
registers before a checkpoint, carries out a simple
computation on ARM NEON after a restore and compares
the result against the result of the same computation
carried out before a checkpoint.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-01 22:45:51 +04:00
Alexander Kartashov
1982fddb53 cr: generalized the prototype of the routine restore_fpu()
A struct sigframe* instead of fpu_state_t should be passed
to the routine restore_fpu() since FPU registers are stored
in different fields of the sigframe in different architectures.
An architecture-specific implementation of the routine restore_fpu()
should know details of this layout instead of construct_sigframe().

This change makes it possible to move ARM FPU restoration
from sigreturn_prep_fpu_frame() (where it caused a segfault
since the pointer fpu_stat has become invalid in the dumper
address space) to restore_fpu()

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Acked-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-06-01 22:45:49 +04:00