From: Serge Hallyn Date: Fri, 16 Aug 2013 20:50:25 +0000 (-0500) Subject: lxc-clone: default to overlaysf for -s clone of dir X-Git-Tag: lxc-1.0.0.alpha1~1^2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3fdf5cc9c60eb97f8520f059ad1a09d3f73509d;p=thirdparty%2Flxc.git lxc-clone: default to overlaysf for -s clone of dir If you go to the trouble to request a -s (snapshot) clone of a container which is dir backingstore, then you deserve an overlayfs clone. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index c96ccfe50..60d929033 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -1922,6 +1922,12 @@ struct bdev *bdev_copy(const char *src, const char *oldname, const char *cname, } } + /* + * If newtype is NULL and snapshot is set, then use overlayfs + */ + if (!bdevtype && snap && strcmp(orig->type , "dir") == 0) + bdevtype = "overlayfs"; + new = bdev_get(bdevtype ? bdevtype : orig->type); if (!new) { ERROR("no such block device type: %s", bdevtype ? bdevtype : orig->type);