...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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>