]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/tools/lxc_start.c
api: convert lxc_start
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 22 Aug 2013 15:27:40 +0000 (10:27 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 26 Aug 2013 11:23:27 +0000 (06:23 -0500)
commit79622932f21d22db36a0b6cca129f559b5e76108
tree035106f44ada6d87ffe51931a9920a6f6290c361
parentcb0c6c020314ee0fea0ce30d209711f7e9c29aaa
api: convert lxc_start

Normal lxc-start usage tends to be "lxc-start -n name [-P lxcpath]".
This causes $lxcpath/$name/config to be the configuration for the
container.  However, lxc-start is more flexible than that.  You can
specify a custom configuration file, in which case $lxcpath/$name/config
is not used.  You can also (in addition or in place of either of these)
specify configuration entries one-by-one using "-s lxc.utsname=xxx".

To support this using the API, if we are not using
$lxcpath/$name/config then we put ourselves into a custom lxcpath
called (configurable using LXCPATH) /var/lib/lxc_anon.  To stop a
container so created, then, you would use

lxc-stop -P /var/lib/lxc_anon -n name

TODO: we should walk over the list of &defines by hand and set them
using c->set_config_item.  I haven't done that in this patch.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_start.c