It's a struct to prevent using usual arithmetic operations.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v2:
- open_mount is cleaned up
- byte-stream hex conversion remains untouched since
strtol is flipping numbers to LE manner
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
To reflect the change in kernel v3.4-rc4
update PR_GET_TID_ADDR and rename it to
PR_GET_TID_ADDRESS as it named in kernel.
[xemul: this fixes futex test broken with 3.4 rebase]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Some of them (FC12 I debug on) doesn't have fown_ex stuff in their
libc. Add the missing declarations.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We will need them in file descriptors transfer addressed in further patches.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Though we can use libc's syscall() wrapper
I would prefer to have own implementation
in case if we will need it in non-libc bindable
code.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
The ptrace seize doesn't prevent signals from delivery. That said,
we should block the signals in the target task before dumping
anything which is signals-related, i.e. memory and registers.
But once we've blocked signals, we should dump registers before
unblocking them, since any postponed signal will screw things up.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
These defines are already provided by unistd.h, and the only user
is log.c which already includes unistd.h.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
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>
These are setXXXid, capset and various bits for prctl and caps machinery.
The thing is that the caps API is not yet fully in glibc so we have to
declare some bits even for core code, not just for restorer/parasite.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Handle SIGCHLD and if someone failed, nr_in_progress is set to -1.
If crtools notices that nr_in_progress is negative, it kills all
tasks.
v2: * Use named constants for task_entries->start in restorer.c
* Use SA_NOCLDWAIT when setting sigchild handler,
this makes sigchild handler simpler.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This as well forces to move ptrace
definitions into ptrace.h, otherwise
freshly fetched kernel headers become
conflict with existing ptrace constants.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Since we operate with syscalls directly we are
to convert signal's structures between image and
kernel formats, without intermediate glibc layer.
Note this involves chaging sa_entry::flags to u64
(since it's long int value in kernel).
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
If a task is sleep in syscall, it should be restared.
This logic is moved from kernel do_signal().
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
A parasite code dumps all sigactions in sigact.pid.
v2: remove hard code for sizeof(sigset_t)
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tejun Heo proposed to use more general names
unrelated to checkpoint-restore procedure.
So be it (maybe someone else will need this
entries as well).
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
They are actually banned in kernel for now, but
we might end up needing them, so better to have
them in-place.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>