mount: change cwd on the root before restoring mntns (v2)

We are going to make pivot_root after restoring mount name-space,
so relative paths will be used for mountpoints.

v2: print correct root in a error message
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mounts: use relative paths for mountpoints (v2)

We are going to restore mounts before changing root. For that the
current dir is changed in a new root and mounts will be restored by
relative paths.

v2: don't use snprintf
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mounts: make pivot_root after restoring mount points

We are using tar for resting tmpfs. Currently we execute tar from a
restored root, but nobody guarantees that it is there and that it's
really tar.

We don't have reason to change root too early. Lets live in a source
root as long as we can, because we can be sure that it's consistent.

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

v2: remove redundant chdir()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm/tempfs: check that overmounted parts are restored (v2)

v2: check that plain file opened on tempfs
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>