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

800 Commits

Author SHA1 Message Date
Kinsbursky Stanislav
2e0e295b51 zdtm: don't wait in IPC queue on message operations
Otherwise test will sleep in kernel in case of queue is emptry on read or
queue is full on write.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 16:05:52 +04:00
Andrey Vagin
ece90f467c zdtm.sh: check that dump is non-destructive
This patch adds new option -d.
zdtm.sh -d ... does not do restore and instead of that it
wakes up test processes after dump and check results of the test.

Signed-off-by: Andrey Vagin <avagin@gmail.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-10 12:45:36 +04:00
Kinsbursky Stanislav
eb44dc38d3 zdtm: IPC semaphores migration test
2 processes - 1 semaphore per each. Both processes checks it's sem migration
by id. Child also checks parent semaphore migration my key.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
a0e7d4fda1 zdtm: static/msgque test update
v2: msgque test removed from zdtm.sh (feature is not supported yet)

1) Added namesapce isolation
2) Added non-empty queue state before migration
3) Added one more backward message send (child send message back
after receiving one from parent).

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
d131bdfcee zdtm: update static/ipc_namespace test due to ns isolation changes
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
1094c358fe zdtm: update static/utsname test due to ns isolation changes
v2: fixed returning zero (errno) value in case of sys_write() didn't fail.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
9b598d01f0 zdtm: update static/shm test due to ns isolation changes
v2: added missed prints on error pathes

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
f5f931f0aa zdtm: enhance namespaces isolation environment
1) pass cmd line args to function to clone to - required for parametrized
tests.
2) handle function result  - required for multi-process tests.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
c79532b435 zdtm: return positive value from clonned process
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-10 12:41:57 +04:00
Kinsbursky Stanislav
7ebf757d16 IPC: restore shared memory
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 13:21:46 +04:00
Kinsbursky Stanislav
516099d885 IPC: show shared memory dump content
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 13:21:46 +04:00
Kinsbursky Stanislav
3d886be2c6 IPC: dump shared memory
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 13:21:46 +04:00
Kinsbursky Stanislav
9ef1cb99b6 show: add IPC variables to "show all" command
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 13:00:03 +04:00
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