2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00
Commit Graph

4636 Commits

Author SHA1 Message Date
Andrey Vagin
61f50a9cf9 zdtm: remove warnings 2012-01-27 13:10:12 +04:00
Andrey Vagin
003b6e906b zdtm: move tast_daemon after preparation actions 2012-01-27 13:08:19 +04:00
Andrey Vagin
8818ee72e6 zdtm: fix warnings in mmx00.c
mmx00.c:22:34: warning: array subscript is above array bounds
[-Warray-bounds]
mmx00.c:22:34: warning: array subscript is above array bounds
[-Warray-bounds]

PSUBW handles 64 bits.
2012-01-27 12:56:22 +04:00
Cyrill Gorcunov
d4cfba8947 restore: Bring original SIGCHLD handler back once task is restored
Otherwise if restored task exit we get error message in form

 | Error (cr-restore.c:1302): 7244 exited, status=0

while restored task simply finished working.

Pointed-out-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 12:39:42 +04:00
Andrey Vagin
af7a89778c zdtm: say no to EINTR
Everyone have known that EINTR is returned due to cpt/rst.
But it's error, we forgot to set SA_RESTART;).
2012-01-27 12:32:02 +04:00
Andrey Vagin
6a7124895a zdtm: fix warning in Makefile
Makefile💯 warning: overriding commands for target cmdlinenv00.pid'
Makefile:91: warning: ignoring old commands for target cmdlinenv00.pid'
2012-01-27 11:30:31 +04:00
Andrey Vagin
fc2de17444 zdtm: fix warning in transition/ptrace.c 2012-01-27 11:24:05 +04:00
Andrey Vagin
88bd35a47a zdtm: initilize a variable in cmdlinenv00.c 2012-01-27 11:16:09 +04:00
Cyrill Gorcunov
9d913b6551 sockets: Fix freeing dgram sockets data
Otherwise use-after-free error happens.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-27 02:33:32 +04:00
Cyrill Gorcunov
c2353b30a2 make: Add *.i target
Convenient for debug purpose.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 02:32:30 +04:00
Pavel Emelyanov
16c58dbd11 magic: Fix PIPEFS_MAGIC constant
This one is actually an internal kernel magic number for pipefs filesystem
and shouldn't be changed.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-26 20:42:45 +04:00
Pavel Emelyanov
60dee71484 magic: Change magic numbers
Existing ones are boring. Let's switch them into geographical coordinates
of various Russian towns in NNNNEEEE form.

4 digits for a coordinate give us up to 2km of inaccuracy, which is more
than enough to find a town. We cannot use longitude further than 99.99,
i.e. we won't cover the Far East region, but that's OK -- there's more than
enough good candidates even in the European part of the country only.

Feel free to extend.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 19:49:27 +04:00
Andrey Vagin
c05517b131 zdtm: fix test "fork"
* handle EINTR
* add more details in an error message

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 19:47:58 +04:00
Pavel Emelyanov
dcd64e9d10 zdtm: Test for UTS namespace
Plus a small infrastructure change to fork a test task
in a desired namespace.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 19:04:09 +04:00
Pavel Emelyanov
98f4c2e4de ns: Support UTS namespace
Only two fields are modifiable -- hostname and domainname. So
read them on dump and write on restore.

File format is simple --

u32 magic
u32 length of nodename
u8[] nodename string
u32 length of domainname
u8[] domainname string

For OpenVZ we can write the release at the end, but this is later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 16:54:22 +04:00
Pavel Emelyanov
3391416a1b crtools: Namespaces support skeleton
New option -n to dump/restore namespaces.

Fork the namespaces dumping task and write a helper for switching a namespace.

Prepare the restorer code for restoring namespaces before root task.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 16:54:22 +04:00
Pavel Emelyanov
b5e5aac9e9 restore: Switch task fork-ing into clone-ing
In order to restore task in namespaces we'll have to clone() them,
not fork. Thus switch the restorer into using clone.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 16:54:22 +04:00
Pavel Emelyanov
2e48f0528b crtools: Move options deeper into the code
I will need them in the place where we restore the root task.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 16:54:22 +04:00
Pavel Emelyanov
8e90a9e6d8 crtools: Tossing CR_FD_ bits around
Split the CR_FD_ bits into per-task and global ones and replace
of CR_FD_DESC_NOPSTREE with CR_FD_DESC_TASK, which is explicit
set of per-task bits.

The CR_FD_DESC_NS will appear soon.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-26 16:54:22 +04:00
Stanislav Kinsbursky
993f07ba71 zdtm: print full dump or restore path on error
Usefull for debugging.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-01-26 14:55:27 +04:00
Stanislav Kinsbursky
01d13d9643 zdtm: patch for socket_listen test
Cleanup and simplifyng (as requested).

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-01-26 14:55:27 +04:00
Cyrill Gorcunov
d2f664b877 make: Eliminate deps build on no-deps targets in zdtm
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
bafb5f1ecc make: clean' target should include cleandep' zdtm target
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
a3d2b8d2d0 make: Include Makefile.inc into legacy tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
408dcbc182 make: Add Makefile.inc
Common code for all makefiles.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 19:14:39 +04:00
Cyrill Gorcunov
cfb2d1b029 make: Fix typo in `test' target
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-25 16:56:57 +04:00
Cyrill Gorcunov
b0467f2d8c sockets: Report relative name itself
This is more informative to know which exactly name failed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-25 16:55:36 +04:00
Cyrill Gorcunov
a88cd36e7b make: Move legacy tests to test/legacy and use "make test" to run zdtm tests
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 19:59:53 +04:00
Pavel Emelyanov
71fca5d2da zdtm: Include itimers test in suite
And increase the timeout value, since the timers test checks for counters
for more than 5 seconds...

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:42:32 +04:00
Pavel Emelyanov
b7de83aaf3 crtools: Interval timers support
Timers are dumped from inside parasite code, the format is plain -- just
3 pairs of interval/value one-by-one.

The restoration occurs in two stages -- first prepare the timer values in
restorer (and check for sanity), then setup the timers in the latest stage
before actually calling the sigreturn.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:41:49 +04:00
Pavel Emelyanov
6ab01f7a16 syscalls: Add set/get itimers syscalls
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:41:40 +04:00
Pavel Emelyanov
815168ddff parasite: Helper for opening dump file in parasite
Move the common file-opening code into a separate function.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:41:32 +04:00
Pavel Emelyanov
db7dd32203 parasite: Braces around set-status macro arguments
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:41:23 +04:00
Pavel Emelyanov
d4f8e4680f dump: Prepare file for parasite helper
Just move common code of preparing a file for parasite.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:41:13 +04:00
Pavel Emelyanov
043bf95fb8 parasite: Arguments sanitation
Remove typedefs and make the common part of sigacts and pages dumping arguments
for dumping something into a specific file. Will be used almost as-is soon.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-24 18:40:32 +04:00
Cyrill Gorcunov
ed3405cf09 zdtm: Add cmdlinenv00 test case
To test restore of commandline, envirion
and auxv vector.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
701142b2d2 restore: Add restore of argv, env and auxv
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
0008148686 restore: Restore cmdline arguments, envirion and auxv restore
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
57e7cb6941 dump: Print message about obtaining sigmask
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
a9fd7583e6 show: Add cmdline args and envirion entries
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
3ceb96cee7 dump: Save auxv vector in checkpoint image
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:08 +04:00
Cyrill Gorcunov
415b789cbf image: Add mm_saved_auxv entry
It's needed for auxv dump and restore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:07 +04:00
Cyrill Gorcunov
faf41eb5b2 dump: Dump cmdline and envirion parameters
It implies update to kernel side as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-24 18:01:07 +04:00
Cyrill Gorcunov
e69cea25db make: Drop restorer-log.c inclusion in restorer.c
Compile it as a separate file and use ld to merge two
files.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Vagin <avagin@openvz.org>
2012-01-23 11:41:55 +04:00
Pavel Emelyanov
2e070f114c zdtm: Test for zombie tasks
Test that 2 different exit()-ed zombies and 2 killed with different
signals are handled properly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:44:09 +04:00
Pavel Emelyanov
5c2083ee87 cr: Support zombie tasks
Dump the core-pid.img file only. On restore select the way of killing
task based on his exit_code -- exit or kill with a signal. Before dying
unblock all the handlers and set SIG_DFL to it (to make the dead signal
other than KILL be deliverable).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:44:01 +04:00
Pavel Emelyanov
3822c079c4 restore: Ignore ENOENT when preparing shared resources
The absent image file on shared resources preparation now means -- no resources
for this pid (zombies will not have these files).

This is not the most elegant solution, but I don't have anything better in mind.
Need to think over, all the more so we're most likely about to reimplement the
way image is stored some day in the future.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:43:53 +04:00
Pavel Emelyanov
6144431198 dump: Check fro task state on dump
Don't dump tasks in any state but T (stopped). Will extend it with Z soon.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:43:44 +04:00
Pavel Emelyanov
18aaad6164 img: Extend task image with state and exit code
Introduce 3 states we will have to work with:

* alive for tasks sleeping or running
* dead for zombies
* stopped for stopped tasks. We cannot distinguish tasks in this state now,
  but with freezer cgroup this will become possible

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:43:36 +04:00
Pavel Emelyanov
21bbfee919 proc: Read exit code from /proc/pid/stat
Requires patch #14 (for kernel). Also check for number of entries read be
at least required, not exactly equal for forward compatibility.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-23 01:43:28 +04:00