Revert "storage: prefix all nbd paths"

This reverts commit bdca6500. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 3e3f2730
...@@ -116,21 +116,17 @@ int nbd_detect(const char *path) ...@@ -116,21 +116,17 @@ int nbd_detect(const char *path)
int nbd_mount(struct bdev *bdev) int nbd_mount(struct bdev *bdev)
{ {
int ret = -1, partition; int ret = -1, partition;
char *src;
char path[50]; char path[50];
if (strcmp(bdev->type, "nbd")) if (strcmp(bdev->type, "nbd"))
return -22; return -22;
if (!bdev->src || !bdev->dest) if (!bdev->src || !bdev->dest)
return -22; return -22;
/* nbd_idx should have been copied by bdev_init from the lxc_conf */ /* nbd_idx should have been copied by bdev_init from the lxc_conf */
if (bdev->nbd_idx < 0) if (bdev->nbd_idx < 0)
return -22; return -22;
partition = nbd_get_partition(bdev->src);
src = lxc_storage_get_path(bdev->src, bdev->type);
partition = nbd_get_partition(src);
if (partition) if (partition)
ret = snprintf(path, 50, "/dev/nbd%dp%d", bdev->nbd_idx, ret = snprintf(path, 50, "/dev/nbd%dp%d", bdev->nbd_idx,
partition); partition);
...@@ -155,13 +151,14 @@ int nbd_mount(struct bdev *bdev) ...@@ -155,13 +151,14 @@ int nbd_mount(struct bdev *bdev)
int nbd_umount(struct bdev *bdev) int nbd_umount(struct bdev *bdev)
{ {
int ret;
if (strcmp(bdev->type, "nbd")) if (strcmp(bdev->type, "nbd"))
return -22; return -22;
if (!bdev->src || !bdev->dest) if (!bdev->src || !bdev->dest)
return -22; return -22;
ret = umount(bdev->dest);
return umount(bdev->dest); return ret;
} }
bool requires_nbd(const char *path) bool requires_nbd(const char *path)
......
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