[lxc-devel] API wishlist

Frederic Crozat fcrozat at suse.com
Fri Dec 7 18:04:07 UTC 2012


Le vendredi 07 décembre 2012 à 12:47 -0500, Stéphane Graber a écrit :
> On 12/07/2012 12:25 PM, Serge Hallyn wrote:
> > Quoting Stéphane Graber (stgraber at ubuntu.com):
> > ...
> >>  - get_version() (not container specific)
> >>  - get_lxc_path() (not container specific)
> >>    Returns the storage path for the containers.
> >>    Defaults to LXCPATH.
> >>  - set_lxc_path(path) (not container specific)
> >>
> >>
> >> Looking at my todolist for this cycle, the highest priority ones for me
> >> would be:
> >>  1) get_lxc_path()
> >>  2) set_lxc_path()
> >>  3) get_cgroup_item()
> >>  4) set_cgroup_item()
> > 
> > How would set_lxc_path() work?  Would all the lxc code be switched to
> > check /etc/default/lxc.conf for the value, and autoconf would only fill
> > in the value in that file?
> 
> So I think we should split the implementation in two:
> 1) Stop hardcoding LXCPATH in all the C code, instead make it default to
> LXCPATH and overrideable by the set_lxc_path() call.
> 2) Discuss implementing a system wide, not container specific, lxc
> configuration file to be used by all distros in a format that's easily
> parsable.
> 
> Implementing 1) will make it easy for individual commands like lxc-list
> to implement an extra argument letting the user override the lookup
> path. It'll also make it much easier to deal with lxc being run as a
> user at some point in the future.
> 
> Obviously, once we have that, some people will want to change the
> default lookup location in one place and have all the commands use that
> path. That's where we need 2) so that we can store that kind of settings
> in a way that's not distro-specific and have all the tools in all the
> different languages to parse that file.

I have to agree with that proposal (and making configuration path being
optionally a different path than the one used for rootfs would be a
plus, like the patch Alexey has been posting for a long time and we are
using on SLES).

-- 
Frederic Crozat <fcrozat at suse.com>
SUSE





More information about the lxc-devel mailing list