[lxc-devel] [lxc/lxc] 4295c5: lxc-destroy: remove btrfs subvolumes

GitHub noreply at github.com
Tue May 26 15:14:33 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 4295c5de9ed4b2e857cf2d981b4de8188bf2de2e
      https://github.com/lxc/lxc/commit/4295c5de9ed4b2e857cf2d981b4de8188bf2de2e
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-05-26 (Tue, 26 May 2015)

  Changed paths:
    M src/lxc/Makefile.am
    M src/lxc/bdev.c
    M src/lxc/bdev.h
    A src/lxc/initutils.c
    A src/lxc/initutils.h
    M src/lxc/lxc_init.c
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  lxc-destroy: remove btrfs subvolumes

Doing this requires some btrfs functions from bdev to be used in
utils.c  Because utils.h is imported by lxc_init.c, I had to create
a new initutils.[ch] which are used by both lxc_init.c and utils.c
We could instead put the btrfs functions into utils.c, which would
be a shorter patch, but it really doesn't belong there.  So I went
the other way figuring there may be more such cases coming up of
fns in utils.c needing code from bdev.c which can't go into lxc_init.

Currently, if we detect a btrfs subvolume we just remove it.  The
st_dev on that dir is different, so we cannot detect if this is
bound in from another fs easily.  If we care, we should check
whether this is a mountpoint, this patch doesn't do that.

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


  Commit: cb6d63a7aadc47b39c0dd62d6661a091dfdf1a4d
      https://github.com/lxc/lxc/commit/cb6d63a7aadc47b39c0dd62d6661a091dfdf1a4d
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-05-26 (Tue, 26 May 2015)

  Changed paths:
    M src/lxc/cgmanager.c

  Log Message:
  -----------
  make cgmanager follow lxc.cgroup.use

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


  Commit: 7f7948206b72f9ad979256b17df950abbc4ac12f
      https://github.com/lxc/lxc/commit/7f7948206b72f9ad979256b17df950abbc4ac12f
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2015-05-26 (Tue, 26 May 2015)

  Changed paths:
    M src/lxc/cgmanager.c

  Log Message:
  -----------
  Use 'cgm listcontrollers' list rather than /proc/self/cgroups

to populate the list of subsystems to use.

Cgmanager can be started with some subsystems disabled (i.e.
cgmanager -M cpuset).  If lxc using cgmanager then uses the
/proc/self/cgroup output to determine which controllers to use,
it will fail when trying to do things to cpuset.  Instead, ask
cgmanager which controllers to use.

This still defers (per patch 1/1) to the lxc.cgroup.use values.

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/0f541e331323...7f7948206b72


More information about the lxc-devel mailing list