2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-05 16:55:43 +00:00
Commit Graph

9635 Commits

Author SHA1 Message Date
Andrey Vagin
2109271601 zdtm: transmit to crtools dump
This functionality is used to check that dump isn't destructive.
2012-02-14 16:22:44 +04:00
Andrey Vagin
a9f130fd82 zdtm: don't kill test processes in case an error
We want to have maximum info about an error.
2012-02-14 16:07:39 +04:00
Kinsbursky Stanislav
6c0b5becf5 zdtm: add static/shm test to IPC ns tests list
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
2012-02-14 15:42:20 +04:00
Kir Kolyshkin
87b5456f62 Makefile: add distclean target
...and move tags/cscope removal to it.

'make clean' is traditionally used to remove all
compiler-generated stuff in order to do a clean rebuild.

'make distclean' cleans more, it is used to prepare sources
for 'make dist' (creating a source tarball).

It is unfortunate to find out you have to run 'make tags cscope'
every time after 'make clean'.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-14 11:27:37 +04:00
Kir Kolyshkin
fcfd705d39 parasite.c: use .space not .skip for inline asm
In the beginning it was the Word, and the Word was .space.
Later, .skip was introduced as a synonym for .space,
initially only for 680x0 platform.

But the sole reason for this patch is that I use clang/llvm
to check the code and unfortunately it does not understand .skip,
printing long ugly warnings I'd like to avoid.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-14 11:27:06 +04:00
Kinsbursky Stanislav
f86d167bf1 ipc: rename struct ipc_seg
This name for the structure is obfuscating, because the structure
will be used also for queues and semaphores sets migration.

This patch renames this structure int ipc_desc_entry. It also renames
all related functions and prints to reflect structure name change.

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-13 21:04:23 +04:00
Pavel Emelyanov
dfa08e86d1 parasite: Mark parasite_execute static
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-13 01:06:07 +04:00
Pavel Emelyanov
e6823c274e parasite: Enlighten parasite cmd/adg injection
Since we now have the parasite memory shared with crtools process we
can just memcpy this data between them.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-13 01:06:07 +04:00
Pavel Emelyanov
354ab03a67 parasite: Enlighten parasite blob injection
I don't like that we poke the parasite into remote space with 4k calls
to ptrace. Now we have the /proc/pid/map_files/ dir which helps us sharing
a mapping with some other process.

Use this -- map the remote area for parasite locally and put the parasite
blob into it with simple memcpy.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-13 01:06:06 +04:00
Pavel Emelyanov
2b1a58b3b4 parasite: Remove unneeded on-stack variables
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-13 01:06:06 +04:00
Pavel Emelyanov
250d4e9111 parasite: Remove extra on-stack regsets
In fact all we need for parasitic syscall is -- original regs and some
regs with syscall args to work on. The former one is obtained in the
infect/cure code and the latter one is located (and copied from orig)
nearby.

That said, we can simplify all the regs passing-down code by removing
intermediate instances and utilizing the top-level reg-s for this.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:30 +04:00
Pavel Emelyanov
cf662edc56 parasite: Make mmap/munmap_seized static
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:30 +04:00
Pavel Emelyanov
aef3c0af43 parasite: Minor getregs optimisation
No need in getting regs one more time -- we have the orig_regs at hands.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
cdbd2563bf parasite: Symplify syscall_seized
There's no need in 3 instances of regs in arguments. One is more than enough.
Plus, this one can be made static.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
4437a1cf59 parasite: Remove unneeded getregs
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
c56574b411 dump: Obtain task brk via misc dump command
Right now we do syscall_seized for this, but we have the misc dumping command
and the core is (after patch #3) dump after parasite, so we can get brk from
the misc dump, thus avoiding one more switch to parasite.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
583a7fe8c3 dump: Move core dumping behind parasite code run
This is required for patch #4

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
028d5df3b0 parasite: Remove kill_seized
It's not used in code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Pavel Emelyanov
227f177194 cr: Split dumped pages locations
This actually does two things:

1. The parasite code writes to pages _or_ to pages_shared file himself based
   on a hint given from the main program. This avoids shared pages copying
   in finalize_core.

2. The private pages are moved out of the core file into a separate one. This
   avoids private pages copying in finalize_core.

The goal of this patch is a) to avoid pages copying at all (we still have
one on restore, but fixing this requires Andrey's work on shared memory
dumping) and b) make big blobs with pages be stored in separate files (I
have plans on its format rework and unification).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-12 11:45:29 +04:00
Kir Kolyshkin
76a0186c1c sockets.c: use pr_perror() where appropriate
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-11 11:58:32 +04:00
Kir Kolyshkin
41fb6b3f6b show_unixsk(): avoid buffer overflow
Say in case of corrupted img file

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-11 11:58:23 +04:00
Kir Kolyshkin
bf1ca46d43 show_unixsk(): show backlog for real
This is probably a typo in commit 1a1979c

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-11 11:58:15 +04:00
Kir Kolyshkin
b5a377ca7d files.c: fix error message
Use perror since read() set errno.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-11 11:58:06 +04:00
Pavel Emelyanov
717994a4fd restore: Don't parse pstree twice
This file is parsed once to find who to fork and then for the 2nd
time to find threads to create.

Remove the 2nd parse holding the info found on the 1st stage in
local *me variable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 20:29:21 +04:00
Cyrill Gorcunov
36dc98ad2a dump: Fix test for syscall return
Only the low 32 bits of orig_ax are meaningful
for obtaining syscall number so we need to test
if sign extended bits are greater than 0.

Reported-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2012-02-10 18:57:13 +04:00
Kir Kolyshkin
82e548ecca socket.c: use const whenever possible
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 18:07:19 +04:00
Kir Kolyshkin
d5fa75c004 sockets.c: Fix/unify some error messages
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 18:07:19 +04:00
Kir Kolyshkin
fb59be3c11 sockets.c cleanup: break long lines
No code change, pure cleanup

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 18:07:19 +04:00
Kir Kolyshkin
26a7056c26 sockets.c cleanup: no need for backslash when "calling" a define
Fix too long line while at it.
No code change, pure cleanup.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 18:07:19 +04:00
Cyrill Gorcunov
4749ef2626 syscall: Drop unneeded addr variable
Otherwise it become a global variable propagated
even to files where it must has no reference to
(such as parasite code)

Symbol table '.symtab' contains 22 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
     4: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS parasite.c
...
    21: 000000000000b208     8 OBJECT  GLOBAL DEFAULT    3 addr

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 17:38:43 +04:00
Pavel Emelyanov
54091c9b73 sockets: Fix dgram socketpair restore
These are connected, but don't have names. Thus the connect
job fails on them. Use fake ones.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 16:06:49 +04:00
Pavel Emelyanov
f27c83c70c sockets: Off by one in fake address preparation
The fake bind name is trimmed on 1 char.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-10 16:06:39 +04:00
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
Kinsbursky Stanislav
01198ad7df ipc: add error print in case of image read failure during variables restore
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-10 16:02:03 +04:00
Kinsbursky Stanislav
0f1b3229a3 ipc: added error print in case of shm obj read failure
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-10 16:00:43 +04:00
Kinsbursky Stanislav
7147192030 ipc: define KEY as global
Define "KEY" is used also on restore stage.

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-10 14:14:20 +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