parasite: unprotect VMA-s if one of DUMPPAGES operations failed

PARASITE_CMD_DUMPPAGES is called many times and the parasite args
contains an array with vmas at this time, so VMAs can be unprotected in
error case

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ptrace: check that process is stopped by SIGTRAP

All other states are unexpected.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mm: initialize PageEntry pe to NULL in PagemapEntry

Otherwise it contains trash and BUG at page-read.c:98 may be triggered.

https://bugzilla.openvz.org/show_bug.cgi?id=2633

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: bitops: fixed bitops to access more than 32 bits

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mem: don't screen page dump failure

This patch prevents page dump failure screening
by the PARASITE_CMD_MPROTECT_VMAS command success.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm.sh: fix indentations

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm.sh: check snapshot functionality

Only last iteration stops processes, all other iterations make
snapshots. Processes are restored from the last snapshot.

bash -x test/zdtm.sh -s -i 3

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: add a new test case, which create processes in a loop

and this processes live a short period of time. This test case is needed
for testing snapshots.

https://bugzilla.openvz.org/show_bug.cgi?id=2636
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mm: handle new processes which created between snapshots (v2)

These processes don't have image files in a parent snapshot and crtools
should not fail in this case.

https://bugzilla.openvz.org/show_bug.cgi?id=2636

v2: return NULL from mem_snap_init, if a parent image is absent.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
syscalls: Add proper syscalls definition.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add protobuf message and rename to protobuf/timer.proto

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add fd, magic and show functionality.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Parse proc /proc/<pid>/timers and save info in list

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Get info in parasite, and structures

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add dump functionality

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add restore structures

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Restore and fix one timer

This also add function to check if time represented by two numbers is
valid. I.e. for timespec(sec, nsec), sec and nsec must be > 0 and nsec
must be less when NSEC_PER_SEC.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add reading image and put it to shared memory

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Restore timers, need create and delete 'fake' timers

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
posix-timer: Add test non consequent timer ids

Add fake timers to inshure that then timer ids don't go one after
another c/r go well.

Signed-off-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>