pre-dump: do not disconnect from page server before writing to it

Signed-off-by: Jamie Liu <jamieliu@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pie: Fix typo in dump_pages

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Align collect_image_info members assignments

It's a way more easier to read.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Use pr_perror on inotify_add_watch error path

To get more detailed error desciption. Also print watchdog
number if it exceed expected, for better error output.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
kerndat: Don't fail it tcp_*mem sysctls are missing

This can hppen if criu is run in container.

Reported-by: Frederico Araujo <araujof@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
kerndat: Initialize necessary kerndats on restore

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pie: paresite -- Print error codes from syscalls

In case if we hit error returned from syscall, better
to print error code for easier understanding of the
protblem.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
service: Change default socket path to /var/run/

This is where such stuff is typically placed.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
service: Go to daemon with detached terminal and cwd

Logs are put into dedicated logfd, cwd is not used as well.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
flock: Don't assume device maj/min numbers are byte long

Igor reported the following file lock

 | (00.003139) lockinfo: 4:POSIX ADVISORY WRITE 46567 b6:5f0b1:524702 0 EOF
 | (00.003154) lockinfo: 5:POSIX ADVISORY WRITE 46559 b6:5f0b1:524661 0 EOF
 | (00.003172) lockinfo: 6:POSIX ADVISORY WRITE 46543 b6:5f0b1:524326 0 0
 | (00.003188) lockinfo: 7:POSIX ADVISORY WRITE 46543 b6:5f0b1:524367 0 EOF

where device maj number is pretty big and parsing failed.
Fix it removing field width.

Reported-by: Igor Sukhih <igor@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Read sys.last_cap only once in kerndat

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
proc: parse -- Fix length for smaps maj/min parshing

Otherwise

 | Error (proc_parse.c:227): Can't parse: 555555554000-555555577000 r-xp 00000000 b6:d2f61 133545                  /sbin/init

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
test: rpc: fix log_level in test.c and add log_level to test.py

Hi!

Added "has_log_level = true" to test.c, so "log_level = 4" would have effect.
Also added log_level to test.py, for symmetry with test.c.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Add debug printing of the target link

Convenient for debug.

 | (00.005999)   3857: fsnotify:           Restore inotify watch for 0x00800002:0x0000000000000002 (via /proc/self/fd/5 -> /)
 | (00.005999)   3857: fsnotify:           Restore inotify watch for 0x00800002:0x0000000000083a93 (via /home/criu/test/zdtm/live/static/inotify-removed (deleted).cr.1.ghost)

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