[lxc-devel] RFC: aliases

Christian Seiler christian at iwakd.de
Wed Aug 21 11:03:08 UTC 2013


Hi Serge,

> I'm thinking symbolic link may be the simplest thing to support -
> lxc_container_new() could immediately readlink() to get the real
> container name.

Yes, I agree, I'd find such a thing very useful. However, it should not
only be lxc_container_new but also the utilities not using the API,
such as lxc-start etc.

So the desireable behavior would be, in my eyes:

- _Everywhere_, when resolving a container name, see if the
   configuration directory is a symlink. If it is:
     - relativ symlink without a /:
         use destination as effective container name
     - contains / (relative or absolute):
         completely resolve path and see if it starts with
         the configuration directory
            if not -> don't assume anything about the name
                      (i.e. use the supplied one), but do
                      follow symlink if possible (as is
                      currently done)
            if so  -> strip configuration directory from
                      path and use the rest as effective
                      container name

- When showing names (mostly lxc-ls), always show the
   real name by default, never the alias. So if /var/lib/lxc
   contains the following contents
           foo/
           bar/
           baz -> bar
   then lxc-ls should only show foo and bar. An additional
   option for also showing aliases (or only showing aliases)
   may be useful here.

-- Christian





More information about the lxc-devel mailing list