Commit e3fdf5cc by Serge Hallyn

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: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 6fe93aa1
...@@ -1922,6 +1922,12 @@ struct bdev *bdev_copy(const char *src, const char *oldname, const char *cname, ...@@ -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); new = bdev_get(bdevtype ? bdevtype : orig->type);
if (!new) { if (!new) {
ERROR("no such block device type: %s", bdevtype ? bdevtype : orig->type); ERROR("no such block device type: %s", bdevtype ? bdevtype : orig->type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment