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
9a534c22
Unverified
Commit
9a534c22
authored
Jul 19, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: rework lvm backend
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a3e85dae
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
bdev.c
src/lxc/bdev/bdev.c
+15
-2
lxclvm.c
src/lxc/bdev/lxclvm.c
+0
-0
lxclvm.h
src/lxc/bdev/lxclvm.h
+5
-0
No files found.
src/lxc/bdev/bdev.c
View file @
9a534c22
...
@@ -138,8 +138,8 @@ static const struct bdev_ops lvm_ops = {
...
@@ -138,8 +138,8 @@ static const struct bdev_ops lvm_ops = {
.
clone_paths
=
&
lvm_clonepaths
,
.
clone_paths
=
&
lvm_clonepaths
,
.
destroy
=
&
lvm_destroy
,
.
destroy
=
&
lvm_destroy
,
.
create
=
&
lvm_create
,
.
create
=
&
lvm_create
,
.
create_clone
=
NULL
,
.
create_clone
=
&
lvm_create_clone
,
.
create_snapshot
=
NULL
,
.
create_snapshot
=
&
lvm_create_snapshot
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
false
,
.
can_backup
=
false
,
};
};
...
@@ -444,6 +444,19 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
...
@@ -444,6 +444,19 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
return
new
;
return
new
;
}
}
if
(
!
strcmp
(
orig
->
type
,
"lvm"
)
&&
!
strcmp
(
new
->
type
,
"lvm"
))
{
bool
bret
=
false
;
if
(
snap
)
bret
=
new
->
ops
->
create_snapshot
(
c0
->
lxc_conf
,
orig
,
new
,
newsize
);
else
bret
=
new
->
ops
->
create_clone
(
c0
->
lxc_conf
,
orig
,
new
,
newsize
);
if
(
!
bret
)
return
NULL
;
return
new
;
}
if
(
strcmp
(
bdevtype
,
"btrfs"
))
{
if
(
strcmp
(
bdevtype
,
"btrfs"
))
{
if
(
!
strcmp
(
new
->
type
,
"overlay"
)
||
if
(
!
strcmp
(
new
->
type
,
"overlay"
)
||
!
strcmp
(
new
->
type
,
"overlayfs"
))
!
strcmp
(
new
->
type
,
"overlayfs"
))
...
...
src/lxc/bdev/lxclvm.c
View file @
9a534c22
This diff is collapsed.
Click to expand it.
src/lxc/bdev/lxclvm.h
View file @
9a534c22
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#define __LXC_LVM_H
#define __LXC_LVM_H
#define _GNU_SOURCE
#define _GNU_SOURCE
#include <stdbool.h>
#include <stdint.h>
#include <stdint.h>
/* defined in bdev.h */
/* defined in bdev.h */
...
@@ -52,5 +53,9 @@ int lvm_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
...
@@ -52,5 +53,9 @@ int lvm_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
int
lvm_destroy
(
struct
bdev
*
orig
);
int
lvm_destroy
(
struct
bdev
*
orig
);
int
lvm_create
(
struct
bdev
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
int
lvm_create
(
struct
bdev
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
);
struct
bdev_specs
*
specs
);
bool
lvm_create_clone
(
struct
lxc_conf
*
conf
,
struct
bdev
*
orig
,
struct
bdev
*
new
,
uint64_t
newsize
);
bool
lvm_create_snapshot
(
struct
lxc_conf
*
conf
,
struct
bdev
*
orig
,
struct
bdev
*
new
,
uint64_t
newsize
);
#endif
/* __LXC_LVM_H */
#endif
/* __LXC_LVM_H */
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