[lxc-devel] [lxc/lxc] 2ed776: Move lxcbr0 setup logic into lxc.net script

GitHub noreply at github.com
Mon Aug 4 19:51:04 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 2ed776214a3c2b63c87c028582e68a881d5e2a46
      https://github.com/lxc/lxc/commit/2ed776214a3c2b63c87c028582e68a881d5e2a46
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M config/init/upstart/lxc-net.conf
    M src/lxc/Makefile.am
    A src/lxc/lxc.net

  Log Message:
  -----------
  Move lxcbr0 setup logic into lxc.net script

Factor this out of the lxc-net.conf upstart job, so that it can be used by
init.d scripts and systemd units, too.

Part of https://launchpad.net/bugs/1312532

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 213b0fe063ffa03d4ab1307a0dbe234e98693e0b
      https://github.com/lxc/lxc/commit/213b0fe063ffa03d4ab1307a0dbe234e98693e0b
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M config/init/systemd/Makefile.am
    M configure.ac

  Log Message:
  -----------
  Get systemd unit dir from pkg-config

Don't install systemd unit files into $(prefix), they won't work there.
Instead, get them from systemd's pkg-config file.

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 65b27d845f182167aa1620d6225336d722a7e7c5
      https://github.com/lxc/lxc/commit/65b27d845f182167aa1620d6225336d722a7e7c5
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M .gitignore
    M config/init/systemd/Makefile.am
    A config/init/systemd/lxc-net.service.in
    M config/init/systemd/lxc.service.in
    M configure.ac

  Log Message:
  -----------
  Add systemd unit for lxc.net

This is the equivalent of the upstart lxc-net.conf to set up the LXC bridge.

This also drops "lxc.service" from tarballs. It is built source which depends
on configure options, so the statically shipped file will not work on most
systems.

https://launchpad.net/bugs/1312532

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 84b3775a090a3e67514eb5f46d32eabb39fcc068
      https://github.com/lxc/lxc/commit/84b3775a090a3e67514eb5f46d32eabb39fcc068
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M config/init/sysvinit/lxc.in

  Log Message:
  -----------
  systemd: Ensure action() is defined

If /etc/rc.d/init.d/functions is not present or does not define an action()
function, provide a simple fallback using "echo".

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 2b24e2ff84c03a1e049449127958df8dc16a74fd
      https://github.com/lxc/lxc/commit/2b24e2ff84c03a1e049449127958df8dc16a74fd
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M config/init/systemd/Makefile.am
    A config/init/systemd/lxc-apparmor-load
    M config/init/systemd/lxc.service.in

  Log Message:
  -----------
  systemd: Load AppArmor profiles if necessary/supported

On Ubuntu we need to set up the AppArmor profiles also under systemd.
Add a new helper "lxc-apparmor-load" and integrate it into lxc.service.

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 882ab607fdd7386aae7a00dba76513310f28998c
      https://github.com/lxc/lxc/commit/882ab607fdd7386aae7a00dba76513310f28998c
  Author: Martin Pitt <martin.pitt at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M configure.ac

  Log Message:
  -----------
  Install systemd units for Ubuntu

Signed-off-by: Martin Pitt <martin.pitt at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 22c36623bbbe6de7b9fd15f40d7428257bfd8d74
      https://github.com/lxc/lxc/commit/22c36623bbbe6de7b9fd15f40d7428257bfd8d74
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M doc/ja/lxc-start.sgml.in

  Log Message:
  -----------
  doc: Add -F option to Japanese lxc-start(1)

Update for commit 476d302

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 36c94e0d58629aa69fbb055f2fd42647c91afdcd
      https://github.com/lxc/lxc/commit/36c94e0d58629aa69fbb055f2fd42647c91afdcd
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M doc/ja/lxc-start.sgml.in

  Log Message:
  -----------
  doc: Change default to "-d" in Japanese lxc-start(1)

Update for commit c00f3f3

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 9231d3a4bb402089fa5061acac64a1b1b22bae4b
      https://github.com/lxc/lxc/commit/9231d3a4bb402089fa5061acac64a1b1b22bae4b
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M doc/ja/lxc.container.conf.sgml.in

  Log Message:
  -----------
  doc: Add the description of lxc.environment to Japanese lxc.container.conf(5)

Update for commit 7c66172

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 03c315afc1299711831c5a10a06af757aeb382c1
      https://github.com/lxc/lxc/commit/03c315afc1299711831c5a10a06af757aeb382c1
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M doc/ja/lxc.container.conf.sgml.in

  Log Message:
  -----------
  doc: Update the description of SELinux in Japanese lxc.container.conf(5)

Update for commit 719fae0

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 3ca73691b95e3b469e7bd9073a6145b4ee1306e7
      https://github.com/lxc/lxc/commit/3ca73691b95e3b469e7bd9073a6145b4ee1306e7
  Author: KATOH Yasufumi <karma at jazz.email.ne.jp>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M doc/ja/lxc-create.sgml.in
    M doc/lxc-create.sgml.in

  Log Message:
  -----------
  doc: Add 'zfs' to the parameter of -B option in lxc-create(1)

Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: ff462013b67312c730e0c177c439708f28a8c36d
      https://github.com/lxc/lxc/commit/ff462013b67312c730e0c177c439708f28a8c36d
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M src/lxc/Makefile.am
    M src/lxc/bdev.c
    A src/lxc/lxc-btrfs.h

  Log Message:
  -----------
  btrfs: support recursive subvolume deletion (v2)

Pull the #defines and struct definitions for btrfs into a separate
.h file to not clutter bdev.c

Implement btrfs recursive delete support

A non-root user isn't allow to do the ioctls needed for searching (as you can
verify with 'btrfs subvolume list').  So for an unprivileged user, if the
rootfs has subvolumes under it, deletion will fail.  Otherwise, it will
succeed.

Changelog: Aug 1:
  . Fix wrong objid passing when determining directory paths
  . In do_remove_btrfs_children, avoid dereferencing NULL dirid
  . Fix memleak in error case.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 6b0d553864a16462850d87d4d2e9056ea136ebad
      https://github.com/lxc/lxc/commit/6b0d553864a16462850d87d4d2e9056ea136ebad
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-08-04 (Mon, 04 Aug 2014)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/conf.h
    M src/lxc/confile.c
    M src/lxc/confile.h
    M src/lxc/lxccontainer.c
    M src/lxc/lxccontainer.h

  Log Message:
  -----------
  unexpanded config file: turn into a string

Originally, we only kept a struct lxc_conf representing the current
container configuration.  This was insufficient because lxc.include's
were expanded, so a clone or a snapshot would contain the expanded
include file contents, rather than the original "lxc.include".  If
the host's include files are updated, clones and snapshots would not
inherit those updates.

To address this, we originally added a lxc_unexp_conf, which mirrored
the lxc_conf, except that lxc.include was not expanded.

This has its own cshortcomings, however,  In particular, if a lxc.include
has a lxc.cgroup setting, and you use the api to say:

c.clear_config_item("lxc.cgroup")

this is not representable in the lxc_unexp_conf.  (The original problem,
which was pointed out to me by stgraber, was slightly different, but
unlike this problem it was not unsolvable).

This patch changes the unexpanded configuration  to be a textual
representation of the configuration.  This allows us *order* the
configuration commands, which is what was not possible using the
struct lxc_conf *lxc_unexp_conf.

The write_config() now becomes a simple fwrite.  However, lxc_clone
is slightly complicated in parts, the worst of which is the need to
rewrite the network configuration if we are changing the macaddrs.

With this patch, lxc-clone and clear_config_item do the right thing.
lxc-test-saveconfig and lxc-test-clonetest both pass.

There is room for improvement - multiple calls to

c.append_config_item("lxc.network.link", "lxcbr0")

will result in multiple such lines in the configuration file.  In that
particular case it is harmless.  There may be cases where it is not.

Overall, this should be a huge improvement in terms of correctness.

Changelog: Aug 1: updated to current lxc git head.  All lxc-test* and
   python api test passed.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/a96a8e8c09d8...6b0d553864a1


More information about the lxc-devel mailing list