mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-05-29 16:40:52 +00:00
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:
parent
6fe93aa187
commit
e3fdf5cc9c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user