]> git.ipfire.org Git - thirdparty/lxc.git/commit
mod_rdep(): Write path and name of clone to file
authorChristian Brauner <christianvanbrauner@gmail.com>
Tue, 11 Aug 2015 08:33:46 +0000 (10:33 +0200)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 27 Aug 2015 20:14:18 +0000 (15:14 -0500)
commit0ea055b395656950608c9b82009a31344898a035
tree31c197400a589b60baae02be47b4eb878159f67d
parent5e8757eda52b54733bad088492062d061331b0d8
mod_rdep(): Write path and name of clone to file

If we currently create clone-snapshots via lxc-clone only the plain total
number of the containers it serves as a base-container is written to the file
"lxc-snapshots". This commit modifies mod_rdep() so it will store the paths and
names to the containers that are clone-snapshots (similar to the "lxc_rdepends"
file for the clones). **Users which still have containers that have a non-empty
(with a number > 0 as an entry) "lxc-snapshots" file in the old format are not
affected by this change. It will be used until all old clones have been
deleted!** For all others, the "lxc_snapshots" file placed under the original
container now looks like this:

      /var/lib/lxc
      bb
      /var/lib/lxc
      cc
      /opt
      dd

This is an example of a container that provides the base for three
clone-snapshots bb, cc, and dd. Where bb and cc both are placed in the usual
path for privileged containers and dd is placed in a custom path.

- Add additional argument to function that takes in the clone-snapshotted
  lxc_container.
- Have mod_rdep() write the path and name of the clone-snapshotted container the
  file lxc_snapshots of the original container.
- If a clone-snapshot gets deleted the corresponding line in the file
  lxc_snapshot of the original container will be deleted and the file updated
  via mmap() + memmove() + munmap().
- Adapt has_fs_snapshots().
- **If an lxc-snapshot file in the old format is found we'll keep using it.**

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c