Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
094c1904
Unverified
Commit
094c1904
authored
Jul 01, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: prefix all nbd paths
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
11274f69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
lxcnbd.c
src/lxc/bdev/lxcnbd.c
+8
-5
No files found.
src/lxc/bdev/lxcnbd.c
View file @
094c1904
...
...
@@ -117,17 +117,21 @@ int nbd_detect(const char *path)
int
nbd_mount
(
struct
bdev
*
bdev
)
{
int
ret
=
-
1
,
partition
;
char
*
src
;
char
path
[
50
];
if
(
strcmp
(
bdev
->
type
,
"nbd"
))
return
-
22
;
if
(
!
bdev
->
src
||
!
bdev
->
dest
)
return
-
22
;
/* nbd_idx should have been copied by bdev_init from the lxc_conf */
if
(
bdev
->
nbd_idx
<
0
)
return
-
22
;
partition
=
nbd_get_partition
(
bdev
->
src
);
src
=
lxc_storage_get_path
(
bdev
->
src
,
bdev
->
type
);
partition
=
nbd_get_partition
(
src
);
if
(
partition
)
ret
=
snprintf
(
path
,
50
,
"/dev/nbd%dp%d"
,
bdev
->
nbd_idx
,
partition
);
...
...
@@ -152,14 +156,13 @@ int nbd_mount(struct bdev *bdev)
int
nbd_umount
(
struct
bdev
*
bdev
)
{
int
ret
;
if
(
strcmp
(
bdev
->
type
,
"nbd"
))
return
-
22
;
if
(
!
bdev
->
src
||
!
bdev
->
dest
)
return
-
22
;
ret
=
umount
(
bdev
->
dest
);
return
ret
;
return
umount
(
bdev
->
dest
)
;
}
bool
requires_nbd
(
const
char
*
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment