[lxc-devel] [lxc/lxc] 18aa21: snapshots: move snapshot directory

GitHub noreply at github.com
Wed Jun 18 21:30:21 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 18aa217bb187b551206fe66075229ba382a1dbe4
      https://github.com/lxc/lxc/commit/18aa217bb187b551206fe66075229ba382a1dbe4
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-06-18 (Wed, 18 Jun 2014)

  Changed paths:
    M doc/lxc-snapshot.sgml.in
    M src/lxc/bdev.c
    M src/lxc/lxc_snapshot.c
    M src/lxc/lxccontainer.c
    M src/lxc/lxccontainer.h
    M src/lxc/lxclock.c
    M src/lxc/utils.c
    M src/lxc/utils.h
    M src/tests/snapshot.c

  Log Message:
  -----------
  snapshots: move snapshot directory

Originally we kept snapshots under /var/lib/lxcsnaps.  If a
separate btrfs is mounted at /var/lib/lxc, then we can't
make btrfs snapshots under /var/lib/lxcsnaps.

This patch moves the default directory to /var/lib/lxc/c/snaps.
If /var/lib/lxcsnaps already exists, then we continue to use that.

add c->destroy_with_snapshots() and c->snapshot_destroy_all()
API methods.  c->snashot_destroy_all() can be triggered from
lxc-snapshot using '-d ALL'.  There is no command to call
c->destroy_with_snapshots(c) as of yet.

lxclock: use ".$lxcname" for container lock files
that way we can use /run/lock/lxc/$lxcpath/$lxcname/snaps as a
directory when locking snapshots without having to worry about
/run/lock//lxc/$lxcpath/$lxcname being a file.

destroy: split off a container_destroy
container_destroy() doesn't check for snapshots, so snapshot_rename can
use it.  api_destroy() now does check for snapshots (previously it only
checked for fs - i.e. overlayfs/aufs - snapshots).

Add destroy to the manpage, as it was previously undocumented.

Update snapshot testcase accordingly.

[ rebased in the face of commits 840f05df and 7e36f87e. ]

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: S.Çağlar Onur <caglar at 10ur.org>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>




More information about the lxc-devel mailing list