]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Introduce an LXC specific public API & library
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 21 Dec 2012 13:15:19 +0000 (13:15 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Jan 2013 13:58:34 +0000 (13:58 +0000)
commit3d1596b048c27d76a314034e99cd197409f35e55
tree1e825e01e121857fe710c4b64142ff1f82573114
parent907a39e735d256b8428ed4c77009d1f713aea19b
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>
22 files changed:
.gitignore
cfg.mk
configure.ac
daemon/remote.c
docs/Makefile.am
docs/apibuild.py
docs/hvsupport.pl
include/libvirt/Makefile.am
include/libvirt/libvirt-lxc.h [new file with mode: 0644]
libvirt.spec.in
mingw-libvirt.spec.in
python/Makefile.am
python/generator.py
python/libvirt-lxc-override-api.xml [new file with mode: 0644]
python/libvirt-lxc-override.c [new file with mode: 0644]
src/Makefile.am
src/driver.h
src/internal.h
src/libvirt-lxc.c [new file with mode: 0644]
src/libvirt_lxc.syms [new file with mode: 0644]
src/lxc/lxc_driver.c
tools/virsh.c