diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 6d8860967..952cfebec 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -477,7 +477,10 @@ static int dir_destroy(struct bdev *orig) static int dir_create(struct bdev *bdev, const char *dest, const char *n, struct bdev_specs *specs) { - bdev->src = strdup(dest); + if (specs->dir) + bdev->src = strdup(specs->dir); + else + bdev->src = strdup(dest); bdev->dest = strdup(dest); if (!bdev->src || !bdev->dest) { ERROR("Out of memory"); diff --git a/src/lxc/bdev.h b/src/lxc/bdev.h index 7efc1647f..cc0bf02bf 100644 --- a/src/lxc/bdev.h +++ b/src/lxc/bdev.h @@ -48,6 +48,7 @@ struct bdev_specs { char *lv; char *thinpool; // lvm thin pool to use, if any } lvm; + char *dir; }; struct bdev_ops { diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index a3684c16f..eee6ffd79 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -256,8 +256,7 @@ int main(int argc, char *argv[]) spec.lvm.thinpool = my_args.thinpool; } if (my_args.dir) { - ERROR("--dir is not yet supported"); - exit(1); + spec.dir = my_args.dir; } if (strcmp(my_args.bdevtype, "_unset") == 0)