libct: server -- Make sure the socket is initialized

In case of start listening for commands make sure
the libct_session_export_prepare was called before
and socket is listening.

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

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: check req->create for CT_{CREATE,OPEN}

./src/libctd/libctd -s /var/run/libct.sock
Segmentation fault

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

There is no such variable as PROGRAM, we use LIBCT
instead. It's leftover from early draft.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
tests: make -- Make explicit test rules

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rpc: move functions for sending responses in a separate file

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

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rpc: set req_id in responses v2

This is required for multithreaded clients. They can send a few requests
simultaneously and then get reponses for each of them.

req_id is copied from a request to a response.
In a future it will be used for asynchronous requests.

v2: push the whole original req into send_resp()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>