]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
lxc: Inherit namespace feature
authorik.nitk <ik.nitk@gmail.com>
Thu, 20 Aug 2015 13:46:17 +0000 (19:16 +0530)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 26 Aug 2015 10:28:30 +0000 (11:28 +0100)
commitc27553b6e27f46537670a8f9c7dbf286cdd2f551
treeedd72e8824c09b29f40d66ba221c8278edb846d2
parentf674dc6794e0946f89313f477aa7886a4a28188e
lxc: Inherit namespace feature

This patch adds feature for lxc containers to inherit namespaces.
This is very similar to what lxc-tools or docker provides.  Look
for "man lxc-start" and you will find that you can pass command
args as [ --share-[net|ipc|uts] name|pid ]. Or check out docker
networking option in which you can give --net=container:NAME_or_ID
as an option for sharing +namespace.

>From this patch you can add extra libvirt option to share
namespace in following way.

 <lxc:namespace>
   <lxc:sharenet type='netns' value='red'/>
   <lxc:shareipc type='pid' value='12345'/>
   <lxc:shareuts type='name' value='container1'/>
 </lxc:namespace>

The netns option is specific to sharenet. It can be used to
inherit from existing network namespace.

Co-authored: Daniel P. Berrange <berrange@redhat.com>
13 files changed:
docs/drvlxc.html.in
docs/schemas/domaincommon.rng
po/POTFILES.in
src/Makefile.am
src/lxc/lxc_conf.c
src/lxc/lxc_container.c
src/lxc/lxc_container.h
src/lxc/lxc_controller.c
src/lxc/lxc_domain.c
src/lxc/lxc_domain.h
src/lxc/lxc_process.c
tests/lxcxml2xmldata/lxc-sharenet.xml [new file with mode: 0644]
tests/lxcxml2xmltest.c