Make sure logrotate directory exists

Otherwise, `make install` may fail.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Allow dumps of stopped multithreaded processes

CRIU can handle stopped multithreaded processes when all threads
are stopped. Refine the check to allow this case.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Sort x86_64 VDSO entries alphabetically

This will make comparison with other ports easier.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
protobuf: added description of messages to store the AArch64 CPU state

These messages are constructed in the same spirit as ARM and x86 ones
except for two major points:

* general-purpose registers are stored in a variable-length array
  of uint64's: the architecture provides 32 general-purpose registers
  that makes it unfeasible to create a separate protobuf field
  for each of them since it requires a lot of "copy-paste" to convert
  between the struct pt_regs and protobuf message; the length of
  the array storing registers is to be checked by the architecture-
  dependent CRIU code;

* AArch64 FP/SIMD registers are 128 bit long while protobuf lacks
  the support for integers of this size; the FP/SIMD registers
  are stored in an array of uint64, two consecutive elements
  of the array represent a single FP/SIMD register.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr: implemented the support for the AArch64 architecture

aarch64: TLS register checkpoint/restore implementation by Christopher Covington.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: added the AArch64-specific implementation of bit operations

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: mount devpts with the newinstance flag

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: cut a common part of sources for bind-mounts

The source of the root mount may be not equal to "/" and we need to take
this fact into account, when we bind-mount it to somewhere.

For example:

11877 ?        Ss     0:00 ./bind-mount --pidfile=bind-mount.pid --outfile=bind-mount.out --dirname=bind-mount.test
11880 ?        Ss     0:00  \_ ./bind-mount --pidfile=bind-mount.pid --outfile=bind-mount.out --dirname=bind-mount.test
[root@avagin-fc19-cr crtools]# cat /proc/11880/mountinfo
68 42 8:3 /root/git/crtools/test / rw,relatime - ext4 /dev/sda3 rw,data=ordered
43 68 0:33 / /proc rw,relatime - proc proc rw
44 68 0:34 / /dev/pts rw,relatime - devpts pts rw,mode=666,ptmxmode=666
45 68 8:3 /root/git/crtools/test/zdtm/live/static/bind-mount.test/test /zdtm/live/static/bind-mount.test/bind rw,relatime - ext4 /dev/sda3 rw,data=ordered

The 45 mount is bind-mount of the 68 mount.
mi(45)->root = /root/git/crtools/test/zdtm/live/static/bind-mount.test/test
mi(68)->root = /root/git/crtools/test

so the comman part is "/root/git/crtools/test" and the command is
mount --bind /zdtm/live/static/bind-mount.test/test /zdtm/live/static/bind-mount.test/bind

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: dump and restore bind-mounts of the root mount

The root mount is an external mount and its source can be not '/'.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: check bind mounts of the root mount

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
restore: call close_old_fds() after mounting /proc

A process can be restored in a new pidns. close_old_fds() opens
the /proc/PID directory. Without this patch we can see errors like this:
(00.333915)      1: Error (util.c:102): Unable to close fd 6: Bad file descriptor

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
page-xfer: make err-message reflect what realy happen

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: add --track-mem to final snapshot

otherwize it won't use/check parent snapshots, only last one
on restore.

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: protobuf -- Fix deps generation on generated sources

There are a few nits in protobuf generation (which in most
cases are harmless but somethime may cause building procedure
to fail)

 - Deps files over generated sources should be produced only
   when _all_ .proto files are handled, because we include headers
   which are autogenerated as well, thus simply wait until everything
   is complete then use compiler to generate deps files

 - typo in non-clean targes, i rather should use proto-obj-y objects

Reported-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test
-g
mount: add EOL to the error message
devpts: open the ptmx device from the pts mount

Actually we need to open a ptmx device from a proper mount of devpts.
But currently we hard code the path to ptmx as /dev/ptmx. This patch
changes it on /dev/pts/ptmx.
zdtm.sh: don't check path to ptmx

CRIU use a predefined path to open ptmx

-101 -> /dev/ptmx
+101 -> /dev/pts/ptmx
jenkins: add script for checking pre-dump