make: LIBS should not be in prerequisites

Use them explicitly. This fixes problem

 |  LINK     crtools
 | /usr/lib/librt.so: could not read symbols: File in wrong format
 | collect2: ld returned 1 exit status
 | make[1]: *** [crtools] Error 1
 | make: *** [all] Error 2

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Kinsbursky Stanislav <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm:fifo: write a few data in the fifo descriptor and check them

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm:fifo: check that read only fifo descriptor is restored

* Create fifo and two descriptors rw and ro
* Write data and close rw descriptor
* Suspend/resume
* Read data from ro descriptor

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
files: Rename file_descs to file_desc_hash

That is what it is -- a hash for file
descriptors based on their ID.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
files: No need to split file_desc_add declaration

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: If address already in use then need increase port.

If address already in use then need increase port.
The problem occured because the socket_listen.c и socket_aio.c
can try to use the same address.

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
restorer: exit all threads in case of error

sys_exit() takes down only the currect thread. exit_group() should
be used to take down all threads.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Looks-good-to: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: ipc_namespace -- Make sure queues_max is not out of range value

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
files: Print symbolic meaning of file restoring status

 |	Restoring fd 5 (state -> create)
 |		Create fd for 5
 |			Going to dup 5 into 5
 |	Restoring fd 0 (state -> receive)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Rename PIPE_NONALIG_DATA to PIPE_MAX_NONALIG_SIZE

And make it dep. on PIPE_DEF_BUFFERS, this points to
a limit from kernel side.

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

Will need it for pipes data dumping.

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

Will need it for fifo data dumping. At moment
the helper is pushed out of compilation procedure
for easier review, and will be real used in next
patch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Make dump_one_pipe to use dump_one_pipe_data

xemul: Why we haven't done this earlier? Because the pe entry contained the
amount of bytes in the pipe and this value had to be calculated before we
wrote this entry into the image. Now the pipe data is stored in another img
file and we can happily split pe dump and pde dump into two calls.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Make pipes_with_data being static

There is no need to make it xmalloc'ed, it's
global for all processes dumped.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Eliminate parasite \t

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Add missing void into func arguments

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Get rid of dangling line in dump_pipe

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

Checkpoint and restore do use fdtype_ops
and file_desc_ops intensively so reorder
pipes functions, this allow us to make
them static and drop additional declarations.

No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Shrink pipe_should_open_transport to want_transport

It's static function near the file_desc_ops,
no need for a long name.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pipes: Style tune up for pipe_info members

 - align members
 - comment with empty line

No func changes.

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