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 <serge.hallyn@ubuntu.com>
This commit is contained in:
Serge Hallyn 2013-08-16 15:50:25 -05:00
parent 6fe93aa187
commit e3fdf5cc9c

View File

@ -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);