libct: build a static version of the library

It will be used for libcontainer. libcontainer is used by tools,
which are executed in a container and libct may be not installed there.

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Merge pull request #15 from avagin/xemul

Here are patches which are required for integration with libcontainer
Merge pull request #16 from avagin/xemul

Basic support of user namespaces, process descriptors, static version of the library, etc
Merge pull request #23 from aburluka/vz_branch

Vz branch

OK, let's go with what we have here. Anything non-yet-working is treated as "sudden bug"...
VZ containers: Initial groundwork

Modified Makefile, make it recognize PCS server
Surrounded uncompilable parts with VZ macros
Added necessary files for further work
Added some already-implemented and easy functions to vz container_ops
Testing makefile is prepared for VZ tests adding

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
VZ containers: kill and wait operations

Implementation

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
VZ containers: implemented spawn_execve

Implementation + test

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
VZ containers: veth network implementation

Implementation + tests

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
VZ containers: added enter_execve

Implementation + test

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
VZ containers: implement some resources constraints

Memory, cpu and blkio limits. Implementation + tests

Signed-off-by: Alexander Burluka <aburluka@parallels.com>
lsm: borrow lsm from LXC

Signed-off-by: Andrey Vagin <avagin@openvz.org>
process: add ability to set a security label (v3)

v2: don't change a security label, if it isn't set.
v3: handle lsm_label in local_desc_copy()

Signed-off-by: Andrey Vagin <avagin@openvz.org>
make: Fix typos for archive libs

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: Eliminate double building of objects

Because src/$(LIBCT).a and src/$(LIBCT).so are
separate targest the make -j2 command yields
two instances of make which are building same
targets simultaneously which leads to unneeded
double generation of dep files and such.

Simply make "so" to depends on "a" because they
are different in linking but not in building
improving build speed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Merge pull request #21 from avagin/xemul

process: add ability to set a security label
make: Fix typos for archive libs

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
make: Eliminate double building of objects

Because src/$(LIBCT).a and src/$(LIBCT).so are
separate targest the make -j2 command yields
two instances of make which are building same
targets simultaneously which leads to unneeded
double generation of dep files and such.

Simply make "so" to depends on "a" because they
are different in linking but not in building
improving build speed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
vz: don't set .add_*id_map

OpenVZ kernels doens't support user namespaces

Signed-off-by: Andrey Vagin <avagin@openvz.org>
ct: enter into a mount namespace after entering into other namespaces

mnt_ns must be the last one. After switching in a mount namespace,
the old /proc becomes inaccessible and we are not able switch other
namespaces

Signed-off-by: Andrey Vagin <avagin@openvz.org>
ct: don't close a file descriptor if it's equal to the required one

Signed-off-by: Andrey Vagin <avagin@openvz.org>