Introduce an LXC specific public API & library
This patch introduces support for LXC specific public APIs. In
common with what was done for QEMU, this creates a libvirt_lxc.so
library and libvirt/libvirt-lxc.h header file.
The actual APIs are
int virDomainLxcOpenNamespace(virDomainPtr domain,
int **fdlist,
unsigned int flags);
int virDomainLxcEnterNamespace(virDomainPtr domain,
unsigned int nfdlist,
int *fdlist,
unsigned int *noldfdlist,
int **oldfdlist,
unsigned int flags);
which provide a way to use the setns() system call to move the
calling process into the container's namespace. It is not
practical to write in a generically applicable manner. The
nearest that we could get to such an API would be an API which
allows to pass a command + argv to be executed inside a
container. Even if we had such a generic API, this LXC specific
API is still useful, because it allows the caller to maintain
the current process context, in particular any I/O streams they
have open.
NB the virDomainLxcEnterNamespace() API is special in that it
runs client side, so does not involve the internal driver API.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-21 13:15:19 +00:00
|
|
|
#
|
|
|
|
# Officially exported symbols, for which header
|
|
|
|
# file definitions are installed in /usr/include/libvirt
|
|
|
|
# from libvirt-lxc.h
|
|
|
|
#
|
|
|
|
# Versions here are *fixed* to match the libvirt version
|
|
|
|
# at which the symbol was introduced. This ensures that
|
|
|
|
# a new client app requiring symbol foo() can't accidentally
|
|
|
|
# run with old libvirt-lxc.so not providing foo() - the global
|
|
|
|
# soname version info can't enforce this since we never
|
|
|
|
# change the soname
|
|
|
|
#
|
|
|
|
LIBVIRT_LXC_1.0.2 {
|
|
|
|
global:
|
|
|
|
virDomainLxcEnterNamespace;
|
|
|
|
virDomainLxcOpenNamespace;
|
|
|
|
};
|
2013-03-12 17:24:01 +00:00
|
|
|
|
|
|
|
LIBVIRT_LXC_1.0.4 {
|
|
|
|
global:
|
|
|
|
virDomainLxcEnterSecurityLabel;
|
|
|
|
} LIBVIRT_LXC_1.0.2;
|
2016-04-14 14:16:22 +00:00
|
|
|
|
2016-06-13 17:34:48 +00:00
|
|
|
LIBVIRT_LXC_2.0.0 {
|
2016-04-14 14:16:22 +00:00
|
|
|
global:
|
|
|
|
virDomainLxcEnterCGroup;
|
|
|
|
} LIBVIRT_LXC_1.0.4;
|