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
667fa8ce
Unverified
Commit
667fa8ce
authored
Jul 17, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: add create_{clone,snapshot}()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
36c55bf3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
bdev.c
src/lxc/bdev/bdev.c
+18
-0
bdev.h
src/lxc/bdev/bdev.h
+4
-0
No files found.
src/lxc/bdev/bdev.c
View file @
667fa8ce
...
@@ -82,6 +82,8 @@ static const struct bdev_ops aufs_ops = {
...
@@ -82,6 +82,8 @@ static const struct bdev_ops aufs_ops = {
.
clone_paths
=
&
aufs_clonepaths
,
.
clone_paths
=
&
aufs_clonepaths
,
.
destroy
=
&
aufs_destroy
,
.
destroy
=
&
aufs_destroy
,
.
create
=
&
aufs_create
,
.
create
=
&
aufs_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
@@ -94,6 +96,8 @@ static const struct bdev_ops btrfs_ops = {
...
@@ -94,6 +96,8 @@ static const struct bdev_ops btrfs_ops = {
.
clone_paths
=
&
btrfs_clonepaths
,
.
clone_paths
=
&
btrfs_clonepaths
,
.
destroy
=
&
btrfs_destroy
,
.
destroy
=
&
btrfs_destroy
,
.
create
=
&
btrfs_create
,
.
create
=
&
btrfs_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
@@ -106,6 +110,8 @@ static const struct bdev_ops dir_ops = {
...
@@ -106,6 +110,8 @@ static const struct bdev_ops dir_ops = {
.
clone_paths
=
&
dir_clonepaths
,
.
clone_paths
=
&
dir_clonepaths
,
.
destroy
=
&
dir_destroy
,
.
destroy
=
&
dir_destroy
,
.
create
=
&
dir_create
,
.
create
=
&
dir_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
false
,
.
can_snapshot
=
false
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
@@ -118,6 +124,8 @@ static const struct bdev_ops loop_ops = {
...
@@ -118,6 +124,8 @@ static const struct bdev_ops loop_ops = {
.
clone_paths
=
&
loop_clonepaths
,
.
clone_paths
=
&
loop_clonepaths
,
.
destroy
=
&
loop_destroy
,
.
destroy
=
&
loop_destroy
,
.
create
=
&
loop_create
,
.
create
=
&
loop_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
false
,
.
can_snapshot
=
false
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
@@ -130,6 +138,8 @@ static const struct bdev_ops lvm_ops = {
...
@@ -130,6 +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_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
false
,
.
can_backup
=
false
,
};
};
...
@@ -142,6 +152,8 @@ const struct bdev_ops nbd_ops = {
...
@@ -142,6 +152,8 @@ const struct bdev_ops nbd_ops = {
.
clone_paths
=
&
nbd_clonepaths
,
.
clone_paths
=
&
nbd_clonepaths
,
.
destroy
=
&
nbd_destroy
,
.
destroy
=
&
nbd_destroy
,
.
create
=
&
nbd_create
,
.
create
=
&
nbd_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
false
,
.
can_backup
=
false
,
};
};
...
@@ -154,6 +166,8 @@ static const struct bdev_ops ovl_ops = {
...
@@ -154,6 +166,8 @@ static const struct bdev_ops ovl_ops = {
.
clone_paths
=
&
ovl_clonepaths
,
.
clone_paths
=
&
ovl_clonepaths
,
.
destroy
=
&
ovl_destroy
,
.
destroy
=
&
ovl_destroy
,
.
create
=
&
ovl_create
,
.
create
=
&
ovl_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
@@ -166,6 +180,8 @@ static const struct bdev_ops rbd_ops = {
...
@@ -166,6 +180,8 @@ static const struct bdev_ops rbd_ops = {
.
clone_paths
=
&
rbd_clonepaths
,
.
clone_paths
=
&
rbd_clonepaths
,
.
destroy
=
&
rbd_destroy
,
.
destroy
=
&
rbd_destroy
,
.
create
=
&
rbd_create
,
.
create
=
&
rbd_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
false
,
.
can_snapshot
=
false
,
.
can_backup
=
false
,
.
can_backup
=
false
,
};
};
...
@@ -178,6 +194,8 @@ static const struct bdev_ops zfs_ops = {
...
@@ -178,6 +194,8 @@ static const struct bdev_ops zfs_ops = {
.
clone_paths
=
&
zfs_clonepaths
,
.
clone_paths
=
&
zfs_clonepaths
,
.
destroy
=
&
zfs_destroy
,
.
destroy
=
&
zfs_destroy
,
.
create
=
&
zfs_create
,
.
create
=
&
zfs_create
,
.
create_clone
=
NULL
,
.
create_snapshot
=
NULL
,
.
can_snapshot
=
true
,
.
can_snapshot
=
true
,
.
can_backup
=
true
,
.
can_backup
=
true
,
};
};
...
...
src/lxc/bdev/bdev.h
View file @
667fa8ce
...
@@ -73,6 +73,10 @@ struct bdev_ops {
...
@@ -73,6 +73,10 @@ struct bdev_ops {
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
bool
(
*
create_clone
)(
struct
lxc_conf
*
conf
,
struct
bdev
*
orig
,
struct
bdev
*
new
,
uint64_t
newsize
);
bool
(
*
create_snapshot
)(
struct
lxc_conf
*
conf
,
struct
bdev
*
orig
,
struct
bdev
*
new
);
bool
can_snapshot
;
bool
can_snapshot
;
bool
can_backup
;
bool
can_backup
;
};
};
...
...
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