After all the child/threads stuff is moved to helpers it is
possible to remove some unneeded code paths and local variables.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Move all the parsing of /proc/pid/children into a helper to be symmetrical
with the threads parsing.
Error from xrealloc is ignored as well.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Move the whole code dealing with parsing threads at collect_pstree
stage into one function.
The nr_threads calculation is performed inside it based on the amount
of directories in /proc/pid/task, not the Threads: count in status.
Error from xrealloc is ignored by now.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
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>
This also depends on kernel's inteface being changed,
so kernel/ is updated as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
If I understand correct, they don't differ in linux.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
It's work for /dev/zero, /dev/null and other simple devices.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
It's because this mask will be restored as rt_sigframe->uc.uc_sigmask.
uc_sigmask will be set as current->blocked in sigreturn, so we should
dump SigBlk in this case.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
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>
ZDTM tests redirect standart descriptors to /dev/null
v2: * Skip tty only if it's a standard descriptor.
* No strcmps on names.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Instead of simply dropping this dead code, put
a warning here, just to be on a safe side.
Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Also re-make image to be 2 pages in size
which should be enough for basic params we
need to restore tasks.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
We will need more options since the
tool should support both cgroups freezer
and a regular task stop/dump/restore/continue
transition.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>