[lxc-devel] 0.9.x versions before 1.0

Stéphane Graber stgraber at ubuntu.com
Thu Jul 11 14:39:10 UTC 2013


On Thu, Jul 11, 2013 at 09:22:47AM -0500, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > To add to the "you broke my lxc-create" list, the new version also
> > dropped the fancy header I introduced a while back (showing the template
> > name, the arguments passed to it and the checksum of the template used
> > at the time.
> > 
> > An example was:
> > # Template used to create this container: ubuntu
> > # Parameters passed to the template: -a amd64 -r precise
> > # Template script checksum (SHA-1): b1f15036868c53cca0698f1efcadd88dfefaee9b
> 
> So as it stands, when you clone a container etc the comments
> get dropped.  When you use the API to add a config item and
> rewrite it, you lose comments.
> 
> How should we handle this?
> 
> One thing we could do is have 'lxc.header' and 'lxc.footer'
> statements which are ignored like comments but which get
> reinserted whenever we write out the config.
> 
> Or, we could simply have the lxcapi_create() function manually
> prepend your fancy header as the very last thing it does, and
> keep everything else the same.
> 
> Preference?
> 
> -serge

It's true that we loose any comment with save_config() and that's fine
as people calling this through the API aren't too likely to actually
read the file by hand anyway.

My problem is the regression on initial config file creation where we
still get the layout and comments inserted by the template but no longer
have the header.

So I think it'd be good enough to have this header generated and
prepended only when the config file is first created (initial
lxcapi_create()) (which I believe is the second option your proposed).

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130711/e97ea3f2/attachment.pgp>


More information about the lxc-devel mailing list