diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-12-21 13:15:19 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-01-14 13:58:34 +0000 |
commit | d18147940f8e330881681c7ef68505ac4463e652 (patch) | |
tree | 1553c58ac179ce3f1f2f6f06eabb20a5c9e04ad1 /libvirt-lxc-override-api.xml | |
parent | 9ad1c7f711344550e971d365faf9987923bc671f (diff) | |
download | libvirt-python-v6-d18147940f8e330881681c7ef68505ac4463e652.tar.gz libvirt-python-v6-d18147940f8e330881681c7ef68505ac4463e652.tar.xz libvirt-python-v6-d18147940f8e330881681c7ef68505ac4463e652.zip |
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>
Diffstat (limited to 'libvirt-lxc-override-api.xml')
-rw-r--r-- | libvirt-lxc-override-api.xml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libvirt-lxc-override-api.xml b/libvirt-lxc-override-api.xml new file mode 100644 index 0000000..db0d45d --- /dev/null +++ b/libvirt-lxc-override-api.xml @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<api name='libvir-lxc-python'> + <symbols> + <function name='virDomainLxcOpenNamespace' file='python-lxc'> + <info><![CDATA[This API is LXC specific, so it will only work with hypervisor +connections to the LXC driver. + +Open the namespaces associated with the container @domain +and return a list of file descriptors associated with the +container. + +The returned file descriptors are intended to be used with +the setns() system call.]]></info> + <return type='int' info='the list of open file descriptors, or -1 on error'/> + <arg name='domain' type='virDomainPtr' info='a domain object'/> + <arg name='flags' type='unsigned int' info='currently unused, pass 0'/> + </function> + </symbols> +</api> |