zdtm.sh: wait page-server by a proper way

page-server is forked and the child is running in background, so a bash
variable $! contains PID of the last command, which is executed in
background.

Currently it's tcpdump and zdtm.sh is waiting it and never returns back.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: the post-dump scripts returns zero, if action is not post-dump

All scripts are executed for all actions, so if one of them failed for
any actions, crtools returns with non-zero code.
E.g: ./zdtm.sh -d ns/static/env00

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Rename parent vmas list variable to reflect what it is

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Add some comments to VMAs inheritance procedure

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: build tree of mounts before dumping them

When CRIU wants to dump content, it checks that nothing is overmounted.
The list of children for such mounts must be empty, but these lists are
filled during constructing a tree of mounts.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
mount: allow to dump content even if a part of fs is overmounted

for that the mount point is bind-mounted in a temporary place.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
zdtm: check that overmounted parts of tmpfs are restored
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.sh: check number of mounts in mountinfo
mount: link dependent mounts (v2)

All shared mounts from one group are connected to circular list.
All slave are added into the proper master list.

v2: change variable name and fix a bug about adding shared mounts in a
circular list.
mount: save group and master in image file (v2)

They are required for restoring shared and slave mounts

v2: use the same names of variables in image and in code
mounts: enumirate mounts bellow specified element
mounts: if a mount can't be mounted, it is queued in postpone list (v2)

Try to restore mounts while a postpone list isn't empty and check
that each iteration has some progress, otherwice it will fails for
preventing infinite loops

v2: rework logic about postpone list
    add more comments
fix
fix
mounts: find mounts, which are propagated from a current one

A few sentences, which are required for understanging this patch

2a) A shared mount can be replicated to as many mountpoints and all the
replicas continue to be exactly same.
2b) A slave mount is like a shared mount except that mount and umount
events only propagate towards it.
2c) A private mount does not forward or receive propagation.

All rules is there Documentation/filesystems/sharedsubtree.txt

If it's a first mount in a group, all group members should be
bind-mounted from this one.

Each mount propagates to all members of parent's group. The group can
contains a few slaves.

Mounts, which have propagated to slaves, are unmounted, because we can't
be sure, that they propagated in real life. For example:

mount --bind --make-slave /share /slave1
mount --bind --make-slave /share /slave2
mount /share/test
umount /slave2/test
mount --make-share /slave1/test
mount --bind --make-share /slave1/test /slave2/test

41 40 0:33 / /share rw,relatime shared:28 - tmpfs xxx rw
42 40 0:33 / /slave1 rw,relatime master:28 - tmpfs xxx rw
43 40 0:33 / /slave2 rw,relatime master:28 - tmpfs xxx rw
44 41 0:34 / /share/test rw,relatime shared:29 - tmpfs xxx rw
46 42 0:34 / /slave1/test rw,relatime shared:30 master:29 - tmpfs xxx rw
45 43 0:34 / /slave2/test rw,relatime shared:30 master:29 - tmpfs xxx rw

/slave1/test and /slave2/test depend on each other and minimum one of them
doesn't propagate from /share/test

Signed-off-by: Andrey Vagin <avagin@openvz.org>
mount: restore shared, slave, private properties.