Unverified Commit 01a066d3 by Christian Brauner Committed by Stéphane Graber

storage: default to orig type on identical paths

otherwise default to "dir" Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 3378303a
...@@ -270,6 +270,9 @@ static struct bdev *do_bdev_create(const char *dest, const char *type, ...@@ -270,6 +270,9 @@ static struct bdev *do_bdev_create(const char *dest, const char *type,
struct bdev *bdev; struct bdev *bdev;
if (!type)
type = "dir";
bdev = bdev_get(type); bdev = bdev_get(type);
if (!bdev) if (!bdev)
return NULL; return NULL;
...@@ -389,7 +392,11 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname, ...@@ -389,7 +392,11 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
*needs_rdep = 1; *needs_rdep = 1;
} }
new = bdev_get(bdevtype ? bdevtype : orig->type); if (strcmp(oldpath, lxcpath) && !bdevtype)
bdevtype = "dir";
else if (!bdevtype)
bdevtype = orig->type;
new = bdev_get(bdevtype);
if (!new) { if (!new) {
ERROR("no such block device type: %s", ERROR("no such block device type: %s",
bdevtype ? bdevtype : orig->type); 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