]> git.proxmox.com Git - mirror_lxc.git/commit
Switch from use of LXCPATH to a configurable default_lxc_path
authorSerge Hallyn <serge.hallyn@canonical.com>
Wed, 6 Feb 2013 21:11:19 +0000 (15:11 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 8 Feb 2013 15:55:14 +0000 (10:55 -0500)
commit2a59a68183e55e38beedb6442938e31eb7d4749c
tree1e57b38ed7b55af740279434a1f33953220a2c87
parent839af5b39bbdc53c0205389145fec108b39811ca
Switch from use of LXCPATH to a configurable default_lxc_path

Here is a patch to introduce a configurable system-wide
lxcpath.  It seems to work with lxc-create, lxc-start,
and basic python3 lxc usage through the api.

For shell functions, a new /usr/share/lxc/lxc.functions is
introduced which sets some of the basic global variables,
including evaluating the right place for lxc_path.

I have not converted any of the other python code, as I was
not sure where we should keep the common functions (i.e.
for now just default_lxc_path()).

configure.ac: add an option for setting the global config file name.
utils: add a default_lxc_path() function
Use default_lxc_path in .c files
define get_lxc_path() and set_lxc_path() in C api
use get_lxc_path() in lua api
create sh helper for getting default path from config file
fix up scripts to use lxc.functions

Changelog:
  feb6:
fix lxc_path in lxc.functions
utils.c: as Dwight pointed out, don't close a NULL fin.
utils.c: fix the parsing of lxcpath line
lxc-start: print which rcfile we are using
commands.c: As Dwight alluded to, the sockname handling was just
   ridiculous.  Clean that up.
use Dwight's recommendation for lxc.functions path: $datadir/lxc
make lxccontainer->get_config_path() return const char *
Per Dwight's suggestion, much nicer than returning strdup.
  feb6 (v2):
        lxccontainer: set c->config_path before using it.
convert legacy lxc-ls

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
20 files changed:
configure.ac
src/lua-lxc/core.c
src/lxc/Makefile.am
src/lxc/commands.c
src/lxc/conf.c
src/lxc/legacy/lxc-ls.in
src/lxc/lxc-clone.in
src/lxc/lxc-create.in
src/lxc/lxc-destroy.in
src/lxc/lxc-setcap.in
src/lxc/lxc-setuid.in
src/lxc/lxc.functions.in [new file with mode: 0644]
src/lxc/lxc_execute.c
src/lxc/lxc_restart.c
src/lxc/lxc_start.c
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h
src/lxc/utils.c
src/lxc/utils.h
src/tests/Makefile.am