mem: Don't export parasite_mptotect_seized

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: Externalize some parasite-executing fns

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mem: Move memory dump routines from parasite-syscall.c into mem.c

There's going to be a LOT of code in there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: Fix regs restore message pid

We work on pid, not ctl->pid in that place.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: Use struct pid on parasite_ctl

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mem: Use ctl's vpid, not the one from arguments

This saves some space on stack.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Reshuffle arguments for dump_task_mm

Will need vpid there soon, so switch to using ctl instead.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
img: Get rid of open_image_ro helper

O_RSTR flag should be used instead for regular open_image

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
check: Drop \n from pr_perror

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
sk-tcp: fix memory leak

CID 996187 (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable "buf" going out of scope leaks the storage it points to.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
sk-packet: fix memory leak

CID 996188 (#1 of 1): Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable sd going out of scope leaks the storage it points to.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
files: Print resource IDs in hex format

We usually print resources IDs in hex format,
so fix the places where we don't (it confuses
otherwise).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
util: read_fd_link -- Drop redundant \n in pr_perror message

pr_perror adds \n on its own, fix this typo.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: print an error message and exit if exec failed

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: free all parts of mnt entries

mnt_entry contains a few strings and they should be release too

CID 996198 (#4 of 4): Resource leak (RESOURCE_LEAK)
20. leaked_storage: Variable "pm" going out of scope leaks the storage
it points to.

CID 996190 (#1 of 1): Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable "new" going out of scope leaks the storage
it points to.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>