mnt: Tossing bits around in validate_mounts

Just for simpler further patching.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
crtools: Introduce the --ext-mount-map option (v3)

On dump one uses one or more --ext-mount-map option with A:B arguments.
A denotes a mountpoint (as seen from the target mount namespace) criu
dumps and B is the string that will be written into the image file
instead of the mountpoint's root.

On restore one uses the same --ext-mount-map option(s) with similar
A:B arguments, but this time criu treats A as string from the image's
root field (foobar in the example above) and B as the path in criu's
mount namespace the should be bind mounted into the mountpoint.

v3:
* Added documentation
* Added RPC bits
* Changed option name into --ext-mount-map
* Use colon as key and value separator

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mnt: Handle external bind mounts according to --ext-mount option (v3)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tmpfs: use device number instead of mnt_id in image names

One file system can be mounted a few times, so mnt_id isn't unique for it.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: dump one file system only once (v2)

A file system can be bind-mounted a few times and some of these mounts
can be non-root. We need to find one of root mounts and dump it.

v2: don't forget to check pm->dumped and pm->parent
    don't dump a root file system, it's always external for now.

Reported-by: Saied Kazemi <saied@google.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: check bind-mounted files in static/mountpoints

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pie: A quick workaround for PR_SET_DUMPABLE == 2 restore error.

[ xemul: It's a temporary workaround not to lock the -rc2 release.
  Once we have some better solution, this will be rolled back. ]

Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
criu: Version 1.3-rc2

Next acheivement -- external bind mounts and tasks-to-cgroups
bindings. Plus many bugfixes in memory restore and mounpoints
dump, many thanks to Google guys for reports and patches!

We have quite a few things left to make workable LXC and Docker
support, hopefully the next tag will be the 1.3 one :)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
vdso: don't forget to adjust vma_area_list->nr

A proxy vdso is removed from the vma_area_list list,
so vma_area_list->nr must be decremented.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
iov: Add iov_grow_page() helper

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
iov: Add iov_init() helper

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
iov: Add iovec2pagemap() helper

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
iov: Add page_server_iov to iov and back helpers

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