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

787 Commits

Author SHA1 Message Date
Kinsbursky Stanislav
65e8eb7a2d show: check UTS ns fd before show
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-09 12:58:53 +04:00
Kinsbursky Stanislav
a0ec1002b2 crtools: cleanup fdset initalization
v2: wrappers names become less obfuscating

This patch:
1) Updates function cr_fdset_open() to be suitable for handling fdset creation
for dump and show stages.
2) Replaces cr_fdset_open() by new wrapper function cr_fdset_dump().
3) Replaces prep_cr_fdset_for_restore() by new wrapper function cr_fdset_show().

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-08 21:43:12 +04:00
Cyrill Gorcunov
fb1d1aa2c6 restorer: Fix code indentation
No func change

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-08 17:06:13 +04:00
Cyrill Gorcunov
6a607827aa restorer: Change endless loop to sys_exit in case of error
If an error happens during late restore stage, we better
exit with error than dive into endless loop.

The loop was useful at early prototype times,
but not now when we use zdtm test suite.

For example, force injected error now reports

 | Restoring EXE (/home/crtools/test/zdtm/live/static/selfexe00)
 | 764
 | 11308
 | Error (cr-restore.c:1280): 11308 exited, status=255
 | Error (cr-restore.c:1412): Someone can't be restored

which is a way better than silent loop.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-08 17:06:13 +04:00
Kinsbursky Stanislav
3665a8972b IPC: use constant pointers where possible
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-08 16:52:48 +04:00
Kinsbursky Stanislav
530f9d9030 IPC: collect and dump tunables sequentially
This patch removes collect stage and dumps tunables object right after
collect.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-08 16:31:41 +04:00
Cyrill Gorcunov
0998335d94 dump: Make sure error code is returned on pr_panic
In case of critical error is happened during checkpoint
procedure, the program should exit immediately.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-08 16:31:33 +04:00
Pavel Emelyanov
82a8a8ff95 sockets: Decode kernel dev_t into stat's one
Unix diag and stat report dev_t-s in different formats. Cast one to
another when comparing in unix dumping.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-08 16:11:27 +04:00
Pavel Emelyanov
02c8793c6e sockets: Fix file-bound sockets check
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-08 12:55:21 +04:00
Kir Kolyshkin
a3fe624c55 sockets00: use snprintf()
Way easier this way.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 23:59:28 +04:00
Cyrill Gorcunov
f5ca8b98fe zdtm: Update sockets00 test -- add dgrams
It looks ugly but test all cases at once.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 20:08:53 +04:00
Cyrill Gorcunov
872ba20f88 zdtm: Add selfexe00 test-case
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-07 20:08:15 +04:00
Cyrill Gorcunov
60f180aa77 Dump all special files in one place
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-07 20:08:06 +04:00
Cyrill Gorcunov
76a249282e restore: Add checkpoint/restore for /proc/pid/exe symlink
This patch adds ability to checkpoint/restore
/proc/pid/exe symlink, so if a process we've just
checkpointed has been say /path/to/exe, then at restore
time we bring this path back.

There some restiction from kernel side: if
existing /proc/pid/exe already mapped more than
once, the kernel will refuse to change the symlink,
so we need to restore it lately when mmaps of crtools
itself already unmapped (ie via late call in
restorer.c).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-07 20:08:01 +04:00
Cyrill Gorcunov
3ba5927081 restorer: Make sure prctl call didn't fail
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-07 20:07:55 +04:00
Cyrill Gorcunov
30bce3db93 tools: Update commit bot
It's temporary action until we move
git repo to own server.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 18:37:03 +04:00
Cyrill Gorcunov
2a77ebbff4 Merge branch 'zdtm' of https://github.com/avagin/crtools
* 'zdtm' of https://github.com/avagin/crtools:
  zdtm: fix silly goto loop in static/shm
2012-02-07 18:03:11 +04:00
Pavel Emelyanov
5b8c7bbf84 sockets: Helper for scheduling acc job
There's only one place with this, but the helper makes the code look
almost perfectly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:28:08 +04:00
Pavel Emelyanov
bc9089e57e sockets: Use RW API in bind sk helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:58 +04:00
Pavel Emelyanov
57eea3d3fd sockets: Helper for binding unix socket
This one reads a name from image, does preparations for bind and calls bind.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:51 +04:00
Pavel Emelyanov
e1ed063f79 sockets: Merge dgram and stream listeners
They fully coincide now, just need to distinguish them by socket type.
Thus, add the type member on the unix_sk_listen and merge two hashes.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:43 +04:00
Pavel Emelyanov
2d9873e051 sockets: Helper for scheduling conn job
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:31 +04:00
Pavel Emelyanov
b845fa3424 sockets: Merge dgram and stream conn jobs
Structure used is the same, logic of connection is the same, and the
infrastructure is ready for this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:24 +04:00
Pavel Emelyanov
23cf6f84d9 sockets: Replace sockets conn job flags with type
Required for simpler future patching.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:16 +04:00
Pavel Emelyanov
8f70115461 sockets: Factor dgram conn job structures more
The unix_dgram_peer coincides with the unix_conn_job.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:09 +04:00
Pavel Emelyanov
5bff96f758 sockets: Factor dgram conn job structures
The unix_dgram_bound fully coincides with the unix_sk_listen.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:27:01 +04:00
Pavel Emelyanov
fe598403df sockets: Delay dgram connection
By the time we try to resolve datagram socket connection name the other
end may not yet be on the hash. Move the address resolution into the
conn job.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:26:52 +04:00
Pavel Emelyanov
aeabf03133 sockets: Datagram connection fix
The address length should be the real length, not the buffer size.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:26:43 +04:00
Pavel Emelyanov
75cb79973e files.c: Use RW API
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 17:18:25 +04:00
Kinsbursky Stanislav
552f5ce320 zdtm: fix silly goto loop in static/shm
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 17:17:18 +04:00
Andrey Vagin
4d746277ad zdtm: correct e-mail 2012-02-07 15:10:50 +04:00
Kir Kolyshkin
f9408a054e test/zdtm.sh: kill the test case process if crtools failed
Do not leave it running

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 15:10:50 +04:00
Kir Kolyshkin
6f5cf13f29 test/zdtm.sh: sanity check for crtools existence
Otherwise test goes too far.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 15:10:50 +04:00
Andrey Vagin
be020f7a6c zdtm.sh: fix error handling 2012-02-07 15:10:50 +04:00
Andrey Vagin
17018e7bb6 socket_listen: add workaround for EADDRINUSE
crtools doesn't restore sockopts, so if a test is executed in
a second time bind() may return EADDRINUSE

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-07 14:09:50 +04:00
Kinsbursky Stanislav
3ca881511b zdtm: shm test update
v2: cleanup issues fixed

What's new:
1) cloning to new IPC ns depends on built option.
2) Check for lookup shared segment by key added.
3) Check for creation new segnent after migration added.
4) Few check for syscalls results added.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 11:22:16 +04:00
Andrey Vagin
2305923ee8 zdtm.sh: add "futex" test
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 11:00:48 +04:00
Kir Kolyshkin
f2734ce825 test/zdtm.sh: formatting fix
Put echo to a separate line to
- keep the text within 80 columns
- visually check that the positions of semicolons are the same

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 11:00:14 +04:00
Kir Kolyshkin
060fb6fed2 test/zdtm.sh: trivial nitpicks
Remove excessive quotes and uneeded semicolons after breaks

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 11:00:08 +04:00
Kir Kolyshkin
6cc9482a1a test/zdtm.sh: simplify showing list of tests
echo normalizes spaces, tr converts them into newlines

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 11:00:01 +04:00
Kir Kolyshkin
60a35bfaa9 test/zdtm.sh: fix check for test name
(1) We should use -w so we can't match a substring
(2) No need to use quotes

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 10:59:56 +04:00
Kir Kolyshkin
0bf98db4d9 test/zdtm.sh: cleanup run_test() calls
If we use shift and $* in run_test(), there is no need to quote arguments.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 10:59:51 +04:00
Kir Kolyshkin
56efc51a5b test/zdtm.sh cleanup: mark local variables as such
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 10:59:38 +04:00
Kir Kolyshkin
dae80231b0 test/zdtm.sh cleanup: remove 30 mentions of $ZP
Replace them by just two.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-07 10:59:11 +04:00
Stanislav Kinsbursky
5059cc7b0a show: ipc cleanup
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 21:27:15 +04:00
Stanislav Kinsbursky
6079c50925 checkpoint: switch namespaces before collect stage
Cleanup patch.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 21:27:07 +04:00
Stanislav Kinsbursky
f054b3821d checkpoint: replace write_img_buf --> write_img ipc code
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 21:26:59 +04:00
Stanislav Kinsbursky
8971be17fd checkpoint: namepsaces info to dump log
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 21:26:50 +04:00
Andrey Vagin
4d962b27c0 crtools: dump and restore clear_tid_address
pthread_join works with this patch

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 17:28:04 +04:00
Andrey Vagin
e8c6c877ed syscall: add set_tid_address
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-03 17:27:31 +04:00