[lxc-devel] [PATCH] ensure all config items are duplicated on clone/write_config

Stéphane Graber stgraber at ubuntu.com
Fri Jan 10 23:08:54 UTC 2014


On Fri, Jan 10, 2014 at 04:59:31PM -0600, Serge Hallyn wrote:
> Quoting Dwight Engen (dwight.engen at oracle.com):
> > Since previously I had found a config item that wasn't being propagated
> > by lxc-clone, I went through all the config items and made sure that:
> >  a) Each item is documented in lxc.conf
> >  b) Each item is written out by write_config
> > 
> > The only one that isn't is lxc.include, which by its nature only pulls
> > in other config item types.
> > 
> > Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
> But one question - should we skip the autostart settings for
> lxc-clone (somehow)?  Consider that lxcapi_clone is used by
> lxcapi_snapshot.  If I create 10 snapshots of my mail server
> I don't want 11 mail servers started on my next boot :)

Though snapshosts won't appear in list_containers so lxc-autostart won't
pick them up.

> 
> > ---
> >  doc/lxc.conf.sgml.in | 11 +++++++++++
> >  src/lxc/confile.c    | 14 ++++++++++++++
> >  2 files changed, 25 insertions(+)
> > 
> > diff --git a/doc/lxc.conf.sgml.in b/doc/lxc.conf.sgml.in
> > index 1350c63..1aa7817 100644
> > --- a/doc/lxc.conf.sgml.in
> > +++ b/doc/lxc.conf.sgml.in
> > @@ -327,6 +327,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> >  
> >  	<varlistentry>
> >  	  <term>
> > +	    <option>lxc.network.mtu</option>
> > +	  </term>
> > +	  <listitem>
> > +	    <para>
> > +	      specify the maximum transfer unit for this interface.
> > +	    </para>
> > +	  </listitem>
> > +	</varlistentry>
> > +
> > +	<varlistentry>
> > +	  <term>
> >  	    <option>lxc.network.name</option>
> >  	  </term>
> >  	  <listitem>
> > diff --git a/src/lxc/confile.c b/src/lxc/confile.c
> > index d21fbec..3c56876 100644
> > --- a/src/lxc/confile.c
> > +++ b/src/lxc/confile.c
> > @@ -2158,6 +2158,12 @@ void write_config(FILE *fout, struct lxc_conf *c)
> >  		fprintf(fout, "lxc.aa_profile = %s\n", c->lsm_aa_profile);
> >  	if (c->lsm_se_context)
> >  		fprintf(fout, "lxc.se_context = %s\n", c->lsm_se_context);
> > +	if (c->seccomp)
> > +		fprintf(fout, "lxc.seccomp = %s\n", c->seccomp);
> > +	if (c->kmsg == 0)
> > +		fprintf(fout, "lxc.kmsg = 0\n");
> > +	if (c->autodev)
> > +		fprintf(fout, "lxc.autodev = 1\n");
> >  	if (c->loglevel != LXC_LOG_PRIORITY_NOTSET)
> >  		fprintf(fout, "lxc.loglevel = %s\n", lxc_log_priority_to_string(c->loglevel));
> >  	if (c->logfile)
> > @@ -2253,4 +2259,12 @@ void write_config(FILE *fout, struct lxc_conf *c)
> >  		fprintf(fout, "lxc.rootfs.mount = %s\n", c->rootfs.mount);
> >  	if (c->rootfs.pivot)
> >  		fprintf(fout, "lxc.pivotdir = %s\n", c->rootfs.pivot);
> > +	if (c->start_auto)
> > +		fprintf(fout, "lxc.start.auto = %d\n", c->start_auto);
> > +	if (c->start_delay)
> > +		fprintf(fout, "lxc.start.delay = %d\n", c->start_delay);
> > +	if (c->start_order)
> > +		fprintf(fout, "lxc.start.order = %d\n", c->start_order);
> > +	lxc_list_for_each(it, &c->groups)
> > +		fprintf(fout, "lxc.group = %s\n", (char *)it->elem);
> >  }
> > -- 
> > 1.8.3.1
> > 
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
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/20140110/be19f5b9/attachment.pgp>


More information about the lxc-devel mailing list