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

644 Commits

Author SHA1 Message Date
Cyrill Gorcunov
641844c349 sockets: Allow to dump unix sockets with inflight connections
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 23:21:06 +04:00
Cyrill Gorcunov
b21c2c8c1d sockets: Print icons numbers in debug printing
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 23:21:06 +04:00
Cyrill Gorcunov
b0e4a2edcd sockets: Add nr_icons member to track number of icons instead of zero ended array
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 23:21:06 +04:00
Cyrill Gorcunov
ff83500f5c sockets: sockest: Show collected socket once they get hashed
Otherwise debug printing has no inode number in report.
Not really it's that important but very convenient
if you need detailed output.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-01-27 23:21:06 +04:00
Cyrill Gorcunov
9b2e191392 sockets: Nitpick on error printing in open_inet_sk
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-27 20:19:01 +04:00
Stanislav Kinsbursky
6e0353badc restore: missed carriage return added
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-27 20:18:26 +04:00
Cyrill Gorcunov
a5228b3bb4 Merge branch 'zdtm' of https://github.com/avagin/crtools
* 'zdtm' of https://github.com/avagin/crtools:
  zdtm: remove warnings
  zdtm: move tast_daemon after preparation actions
  zdtm: fix warnings in mmx00.c
  zdtm: say no to EINTR
  zdtm: fix warning in Makefile
  zdtm: fix warning in transition/ptrace.c
  zdtm: initilize a variable in cmdlinenv00.c
2012-01-27 16:40:50 +04:00
Andrey Vagin
255cd497bd util: print warning if a image file is absent
It may be legal. E.g. for zombie

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-01-27 15:10:38 +04:00
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