rst: Write pidfile in separate fn

Just for better readability.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Remove unneeded core file 2nd opening

Presumablty it was lost while reworking core entry restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Move and rewrite comment about how restorer blob is prepared

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
sk: Rework bound-dev dump/restore according to new API

The SO_BINDTODEVICE getter is changed in the kernel (before
official release) to report not index, but name to be in
harmony with setter.

Fix crtools accordingly.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Revert "net: Introduce netdev index to name resolver"

This reverts commit ef3771d566dacb8ee9fe71b744d56f08674fe3db.
With new SO_BINDTODEVICE getting API it's not required.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
proc-parse: Inotify files migh have no watchee assigned

Same as eventpoll -- we might have no watchee assigned
but only inotify descriptor created.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
log: add pr_err_once

This function prints an error message only once.
[xemul: change ({}) to do {} while (0)]

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
socket: don't fail if DIAG_SHUTDOWN is absent

A error message is printed.

We want to save ability to try crtools on non C/R kernel.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: execute tests on non C/R kernel (v2)

* add exclude list. Tests from this list are executed only on C/R kernels
* check that a version of a kernel is greater than 3.7

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
inotify: Don't forget to close opened files on error path

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: Fix vma printing message (pass 1)

Use %#x for hexademical fields, fix names to more human-readable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: Fix vma printing message (pass 2)

Remove the ?: ladder, replace it with opt string directly
get from status flags.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fd: Consolidate . and .. checks in various readdir callers

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ipc: update to use sysctl

Old interface with modified IPC syscalls is deprecated is replaced sy sysctls.
This patch updates CRIU to use new interface.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ipc: add check for new IPC sysctls

This patch adds check for "/proc/sys/kernel/sem_next_id" to make sure, that
kernel supports restore of IPC objects.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: fix navigation in vim

If you have an error in parasite.c and execute make from vim,
without this patch vim opens a new file parasite.c in a root directory.

With this patch vim opens pie/parasite.c.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: cmdlinenv00 -- fix false positive fail on 'auxv' corruption after 32-bit -> 64-bit migration

Content of /proc/$pid/auxv declared as array of long and this file hasn't compat layer.

https://jira.sw.ru/browse/PSBM-16280

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
check: Check for SO_BINDTODEVICE is get-able

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Helper for restore stage barrier

When finishing a stage we have to report this (decrement the
number of tasks in stage) and wait while stage switch. Write
a helper that does both.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Move initial nr_in_progress initialization

It's better to init it closer to the rest of rst orchestration.

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