protobuf: add image for netlink sockets

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
crtools: add a function for showing netlink sockets

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
crtools: add constants for a netlink image

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

This header is taken from kernel sources.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
sockets: use socket diag for collecting netlink sockets

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

All info about bound sockets are got via socket diag interface.
All connected sockets are automatically bound.
For other sockets only protocol must be dumped, which is got
with help getsockopt.

A netlink sockets with pending data are not supported yet and
probably will not be supported in a near future.

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

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: add a test case for netlink sockets

* create two bound socket (for unicase and broadcase messages),
  a connected socket, an unbound and unconnected socket.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
check: Return -1 on error

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: Add missing \n in cr_pivot_root message

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Use pr_err when reporting error about locks in use and no -l option

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
unix: Make more descriptive error logging for ext socket restore failure

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
check: More verbose messages when sock diag infratructure is missing.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
unix: More verbose output on ext unix socket dumping.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
netlink: Don't signify error code

The netlink layer reports negative error code so no need to
signify it.

[xemul: This is what we do for the rest of the nlk code.]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Missing \n in pr_err message.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
collect: Properly report tasks collecting error

When we've failed to seize tasks we should report this error to the caller.

Reported-by: Kevin Wilson <wkevils@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ptrace: Be more verbose on seize failure

The ptrace seize may fail for various reasons. E.g. -- no enough perms
to get the ptrace access to the tasks, or various selinux restrictions.

Print what exactly has happened when ptrace failed.

Reported-by: Kevin Wilson <wkevils@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
help: Sanitize special resources options

* remove obsoleted --namespaces
* use macro for ext socket option name in help text

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