cpuinfo: Fail if cpuinfo check is requested, but file is missing

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
cpuinfo: Don't report negative values to shell

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: don't execute pipe00 a few times simultaneously

zdtm-pre-dump, zdtm-snapshot, zdtm-iter, zdtm execute pipe00, so
these targets should be executed one by one.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm.sh: don't change owner of a test directory

After changing an owner the current user will not be able to remove or
change the directory. It isn't convenient.

Reported-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
AArch64: Remove TASK_SIZE from mmap_seized

TASK_SIZE for AArch64 may be any of several options between (1 << 39)
and (1 << 48), inclusive, depending on kernel configuration. Go back
to just checking the most significant bit, as was done before commit
3f12d688ae563b91d8a738d68902ea2e23f2b59c was made to accomodate 32-bit
ARM (before mmap_seized got architecture-specific implementations).

This fixes the following error for AArch64 kernels with
CONFIG_ARM64_64K_PAGES=y.

Error (parasite-syscall.c:1105): Can't allocate memory for parasite blob (pid: 104)

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: Align members in assignments

For readability sake.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: Instead of BUG_ON exit out with error early

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: Add some comments about console and bsd terminals

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: Rename helpers to reflect the type of peers

 - parse_index -> parse_pty_index since it's PTY specific
 - pty_is_master -> tty_is_master because it will test
   not only PTY peers but other types as well
 - pty_is_hung -> tty_is_hung for same reason

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: collect_one_tty -- Use tty_is_master helper

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tty: proto -- Add comments on some fields

Actually these @locked and @packet_mode are
valid for unix98 ptys only so since moving
them into @tty_pty_entry is impossible at
least lets comment this.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
restore: don't race when closing cg yard

TASK_HELPERs are created with CLONE_FILES, so if we always close the cg yard
here, it will close it for the other helpers and cause problems. Instead, we
close it much later, in code only called by alive tasks, to ensure that there
is no conflict.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
add int(CTL_32)

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