proc_parse: Print vma start in hex

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
log: Print vma status in dump logs

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
proc_parse: Invert supported VMA check

It's for more natural adding of new else-if branch for aio.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipe: increase the buffer size for pipe identifier

(00.312396)      4: Error (pipes.c:301): Not enough room for pipe 562178190 identifier string

Reported-by: Mr Jenkinks
Cc: Saied Kazemi <saied@google.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Explain how an inherit fd can be reused.

Add comment to inherit_fd_reused() explaining how an inherit fd may be
closed or reused outside the inherit fd logic.

Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: posix_timers -- Don't fail on big @total_sleep_time if migrated, v2

In case if we're migrating to another node where @total_sleep_time
has a big value we might fail here because we don't support tracking
of @total_sleep_time at all, neither we can somehow restore it without
kernel patching (and it's hardly if ever be allowed in vanilla kernel).

Thus simply remember @total_sleep_time value before and after c/r stage
removing it from the computations.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Add root mount point of container as irmap hint

Some packages monitor the FS /.

(00.573051) irmap: Scanning /. hint
(00.573053) irmap: Stat for 110025: INO - 2891453, DEV - 64768
(00.573055) irmap: Refresh stat for /.
(00.573063) irmap: MNTNS_ROOT: 110025, PATH: /., INO: 2891453, DEV: 64768

Signed-off-by: Nikolay Plotnik <nikolay.plotnik@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr-service: setup_opts_from_req: use single error exit point

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr-errno: initial commit

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: set cr_errno to ESRCH if no PID dir in proc

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr-restore: set cr_error to EEXIST if such pid already exists, v3

This is a very common error when using criu.

The problem here is that we need to somehow transfer cr_errno
from one process to another. I suggest using pipe to give
one end to children and read cr_errno on other after restore
is finished.

v2, Pavel suggested putting errno into shared task_entries.
v3. and he also suggested using cmpxchg

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr-service: set cr_errno to EBADRQC if set_opts_from_req fails

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: set additional groups along with uids and gids

Currently zdtm doesn't set additional groups when running
tests. It sets uids and gids to some non-root values, but
additional groups remain untouched, which allows tests
to inherit groups list, which leads to different
behaviour depending on a way you run tests.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: add a test to check non-root shared bind-mounts

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: add vt support, v2

/dev/ttyN are the virtual terminals which are provided
by the system with major 4 and minor 1..63.
You can run some program on ttyN by pressing alt+ctrl+FN
and running it manualy or by using open(openvt nowadays).

This patch also allows us to run all our tests from a vt.

v2, style fix + using linux/vt.h for constants

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm:tty:vt: add simple test

Inspired by static/console test.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty:add comment explaining indices, v2

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
service: add cr_errno to criu_resp and send cr_errno in it, v2

v2, set cr_errno only if we have one that is != 0

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cr_errno: move cr_err helpers into cr_errno.h

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: test for packet socket mappings

It turned out we didn't have one, though recent 3.19-merge-window
kernel would crash on that test.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>