make: add -Wno-unused-result

It's enabled on Ubuntu by default.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
cgroups: Don't forget to remove created dir on fail

If we fail to bind mount the directory we've created
a few lines earlier -- don't forget to remove it then.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
server: keep track states of containers (v2)

The daemon polls signalfd and when it gets SIGCHLD, a state of a proper
container is update.

v2: call waitid with WNOWAIT

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: add support of asynchronous requests (v3)

The ibct server has a limmitted number of threads (currently it has
only one), so the command can't block for a long time.

Now let's look at the ct->wait(). This operation are not going to
complete immediately. This patch adds interface for asynchronous
requests, which allows to handle long requests like ct->wait().

v2: don't forget to set cb_destroy()
v3: include async.h in src/session.c
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
server: don't block in ct->wait

ct->wait() will be done asynchronously. A client request is postponed
and it will be completed when the container will stop.

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