If error happened during queue read don't zap it.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
After reworkring the way pagemap is stored the backward compatibility
was not preserved for patches simplicity. Time to return it back.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The ptrace seize may fail for various reasons. E.g. -- no enough perms
to get the ptrace access to the tasks, or various selinux restrictions.
Print what exactly has happened when ptrace failed.
Reported-by: Kevin Wilson <wkevils@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When we've failed to seize tasks we should report this error to the caller.
Reported-by: Kevin Wilson <wkevils@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The netlink layer reports negative error code so no need to
signify it.
[xemul: This is what we do for the rest of the nlk code.]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
* create two bound socket (for unicase and broadcase messages),
a connected socket, an unbound and unconnected socket.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
All info about bound sockets are got via socket diag interface.
All connected sockets are automatically bound.
For other sockets only protocol must be dumped, which is got
with help getsockopt.
A netlink sockets with pending data are not supported yet and
probably will not be supported in a near future.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Each zombie sends SIGCHLD to parent. crtools restores all pending
signals, so all other signals should be collected.
Here is a problems, that signals SIGCHLD can be merged, but crtools
should be sure, that all signals are collected.
For that a zombie locks a global zombie_lock, which is released by
parent.
This operation should be done between CR_STATE_RESTORE and
CR_STATE_RESTORE_SIGCHLD.
Here is one more CR_STATE_RESTORE_ZOMBIES, whic is used for waiting all
zombies.
v2: clean up
v3: rework synchronization
v4: rework without additional CR_STATE-s
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Alexander, could you help me with ARM? I found in glibc sources, that
sa_restoer should look like this:
ports/sysdeps/unix/sysv/linux/arm/sigrestorer.S
....
ENTRY(__cr_restore_rt)
CFI
mov r7, $SYS_ify(rt_sigreturn)
swi 0x0
.fnend
END(__cr_restore_rt)
v2: Move architecture-dependent code in the proper place
v3: Don't add a separate handler for collecting zombies
Cc: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Read siginfo-s from images and send them to itself by sigqueueinfo.
Thread signals cannot be restored in restore_thread_common, because
it blocks SIGCHLD, which used for error detecting.
v2: Don't remap task_args and thread_args
v3: fix error handling
v4: cosmetic clean up
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
PTRACE_PEEKSIGINFO is used for received pending signals,
then all signal are sent back and saved in a image.
v2: rework according with the new kernel interface
v3: rework according with the newrest kernel interface
v4: fix error handling
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In case if there some error happened better to
know which exactly file failed on open, for example
| Error (files-reg.c:535): Can't open file /lib64/libgcc_s-4.4.7-20120601.so.1 on restore: No such file or directory
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In case if there image corruption and page entry addres
is invalid -- exit out gracefully instead of BUG_ON hammer.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
For example
| Error (protobuf.c:574): Unexpected EOF on /home/crtools/tools/cpt2/test/out/utsns-1.img
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
"Can't fixup VMA's fd" is more understandable than plain
"Can't fixup fd".
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
If a master point has sid, it doesn't mean, that all slave points
will have sid. Look at tty03 for example:
PID SID TT COMMAND
26748 26748 ? tty03
26749 26749 pts/2 \_ tty03
26750 26750 ? \_ tty03
The second process has not a file descriptor for the ctl tty,
but this tty is opened in tty03.
v2: If a slave point with sid has not a master point, the option
--shell-job must be set and sid isn't restored for such terminals.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>