tmpfs: use the --one-file-system option for dumping tmpfs with help tar

Actully for dumping tmpfs it should be remounted to somewhere else to
avoid overmounts.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr: determine the version of the ARM architecture of the target machine

This patch modifies the build system to analyze the version
of the target ARM architecture and setup the compiler flags
accordingly. This makes it possible to support the ARM
architectures prior to ARMv7.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: added the ARMv6 data barrier implementation

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: refactor the syscall glue to support ARMv6

This patch modifies the ARM syscall glue as follows:

* the macros syscallX that produce different code
  for syscalls with different number of arguments
  are replaced by the generic syscall thunk copied
  from libc;

* the syscall tables generation script is simplified
  since the syscall argument number analysis is redundant;

* the ARMv7 specific instruction MOVW is eliminated.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: moved the mincore syscall description

The description of the syscall mincore breaks
the traditional ordering of syscall descriptions.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Move dump_task_mm out of dump_task_core

Mm used to be in code, so the call was left in that place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Remove unused arg from dump_task_core_all

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Factor out thread_core dumping

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
protobuf: Add thread_sas_entry

Will need it to store thread alternative signal stack.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pstree: Allocate and free sas entry

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Add dumping of alternative signal stack

[alekskartashov@: use encode_pointer]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
restore: Add restoration of alternative signal stack

To restore SAS we have two ways:
- call for sigaltstack explicitly in restorer.c right before we call for sigreturn
- pass stack value to sigreturn call and allow the kernel to restore stack for us

Since second way is a simplier one -- we stick with it.

[alekskartashov@: use RT_SIGFRAME_UC]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: dump tid_addr_clear for thread leaders

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: clean up parasite_dump_thread_seized

It is never called for thread leaders, because they are dumped by
dump_task_core_all

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: remove the DUMP_TREAD command

Nobody uses it.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: print error message if a script is failed
debuginfo
test: check, that parasite can rollback itself (v2)

This test uses systemtap to replace random parasite command on
invalide command. The parasite code received this command and should
rollback itself. CRIU didn't recived ack, should understand that
something wrong and exits. The systemtap inverts exit code of criu.

"zdtm.sh -d" is used for executing tests and testing that the state of
processes don't corrupted.

v2: randomize a command, which will be replaced
posix-times: don't fail if /proc/PID/times is absent

/proc/PID/times was added in 3.10, but FC19 relesead with 3.9.

Usually we support only last version of kernel in the project git, so
we can commit it as an additional patch for the fedora package.

Cc: Adrian Reber <adrian@lisas.de>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
zdtm: wait a test process instead of output file

A test should be completed if a test process exited.

Signed-off-by: Andrey Vagin <avagin@openvz.org>