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
04c5582a
Unverified
Commit
04c5582a
authored
Jul 21, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: hide unnecessary symbols
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
169fec00
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
285 additions
and
174 deletions
+285
-174
Makefile.am
src/lxc/Makefile.am
+0
-0
btrfs.h
src/lxc/storage/btrfs.h
+34
-43
dir.h
src/lxc/storage/dir.h
+12
-10
loop.h
src/lxc/storage/loop.h
+12
-10
lvm.h
src/lxc/storage/lvm.h
+19
-17
nbd.h
src/lxc/storage/nbd.h
+15
-14
overlay.h
src/lxc/storage/overlay.h
+18
-18
rbd.h
src/lxc/storage/rbd.h
+12
-10
rsync.h
src/lxc/storage/rsync.h
+6
-4
storage.h
src/lxc/storage/storage.h
+16
-18
storage_utils.h
src/lxc/storage/storage_utils.h
+15
-15
zfs.h
src/lxc/storage/zfs.h
+16
-15
Makefile.am
src/tests/Makefile.am
+110
-0
No files found.
src/lxc/Makefile.am
View file @
04c5582a
This diff is collapsed.
Click to expand it.
src/lxc/storage/btrfs.h
View file @
04c5582a
...
...
@@ -8,8 +8,10 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
#ifndef BTRFS_SUPER_MAGIC
#
define BTRFS_SUPER_MAGIC
0x9123683E
#
define BTRFS_SUPER_MAGIC
0x9123683E
#endif
typedef
uint8_t
u8
;
...
...
@@ -31,8 +33,7 @@ struct btrfs_ioctl_space_args {
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, unsigned long long)
#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
struct btrfs_ioctl_space_args)
#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, struct btrfs_ioctl_space_args)
#define BTRFS_FSID_SIZE 16
struct
btrfs_ioctl_fs_info_args
{
...
...
@@ -42,9 +43,7 @@ struct btrfs_ioctl_fs_info_args {
unsigned
long
long
reserved
[
124
];
};
#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \
struct btrfs_ioctl_fs_info_args)
#define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, struct btrfs_ioctl_fs_info_args)
#define BTRFS_SUBVOL_NAME_MAX 4039
#define BTRFS_PATH_NAME_MAX 4087
...
...
@@ -55,14 +54,10 @@ struct btrfs_ioctl_vol_args {
};
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \
struct btrfs_ioctl_vol_args_v2)
#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
struct btrfs_ioctl_vol_args_v2)
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, struct btrfs_ioctl_vol_args_v2)
#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, struct btrfs_ioctl_vol_args_v2)
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, struct btrfs_ioctl_vol_args)
#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
...
...
@@ -185,8 +180,7 @@ struct btrfs_ioctl_search_args {
char
buf
[
BTRFS_SEARCH_ARGS_BUFSIZE
];
};
#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
struct btrfs_ioctl_search_args)
#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args)
#define BTRFS_UUID_SIZE 16
struct
btrfs_timespec
{
...
...
@@ -283,8 +277,7 @@ struct btrfs_root_item {
__le64
reserved
[
8
];
/* for future */
}
__attribute__
((
__packed__
));
#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
struct btrfs_ioctl_ino_lookup_args)
#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, struct btrfs_ioctl_ino_lookup_args)
#define BTRFS_INO_LOOKUP_PATH_MAX 4080
struct
btrfs_ioctl_ino_lookup_args
{
...
...
@@ -362,30 +355,28 @@ struct my_btrfs_tree {
int
num
;
};
extern
int
btrfs_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
btrfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
btrfs_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
btrfs_detect
(
const
char
*
path
);
extern
int
btrfs_mount
(
struct
lxc_storage
*
bdev
);
extern
int
btrfs_umount
(
struct
lxc_storage
*
bdev
);
extern
char
*
get_btrfs_subvol_path
(
int
fd
,
u64
dir_id
,
u64
objid
,
char
*
name
,
u16
name_len
);
extern
int
btrfs_list_get_path_rootid
(
int
fd
,
u64
*
treeid
);
extern
bool
is_btrfs_fs
(
const
char
*
path
);
extern
int
is_btrfs_subvol
(
const
char
*
path
);
extern
bool
btrfs_try_remove_subvol
(
const
char
*
path
);
extern
int
btrfs_same_fs
(
const
char
*
orig
,
const
char
*
new
);
extern
int
btrfs_snapshot
(
const
char
*
orig
,
const
char
*
new
);
extern
int
btrfs_snapshot_wrapper
(
void
*
data
);
extern
bool
btrfs_create_clone
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
extern
bool
btrfs_create_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
int
btrfs_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
btrfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
btrfs_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
btrfs_detect
(
const
char
*
path
);
__hidden
extern
int
btrfs_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
btrfs_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
char
*
get_btrfs_subvol_path
(
int
fd
,
u64
dir_id
,
u64
objid
,
char
*
name
,
u16
name_len
);
__hidden
extern
int
btrfs_list_get_path_rootid
(
int
fd
,
u64
*
treeid
);
__hidden
extern
bool
is_btrfs_fs
(
const
char
*
path
);
__hidden
extern
int
is_btrfs_subvol
(
const
char
*
path
);
__hidden
extern
bool
btrfs_try_remove_subvol
(
const
char
*
path
);
__hidden
extern
int
btrfs_same_fs
(
const
char
*
orig
,
const
char
*
new
);
__hidden
extern
int
btrfs_snapshot
(
const
char
*
orig
,
const
char
*
new
);
__hidden
extern
int
btrfs_snapshot_wrapper
(
void
*
data
);
__hidden
extern
bool
btrfs_create_clone
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
bool
btrfs_create_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
#endif
/* __LXC_BTRFS_H */
src/lxc/storage/dir.h
View file @
04c5582a
...
...
@@ -6,21 +6,23 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
int
dir_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
dir_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
dir_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
dir_detect
(
const
char
*
path
);
extern
int
dir_mount
(
struct
lxc_storage
*
bdev
);
extern
int
dir_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
dir_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
dir_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
dir_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
dir_detect
(
const
char
*
path
);
__hidden
extern
int
dir_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
dir_umount
(
struct
lxc_storage
*
bdev
);
#endif
/* __LXC_DIR_H */
src/lxc/storage/loop.h
View file @
04c5582a
...
...
@@ -6,21 +6,23 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
int
loop_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
loop_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
loop_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
loop_detect
(
const
char
*
path
);
extern
int
loop_mount
(
struct
lxc_storage
*
bdev
);
extern
int
loop_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
loop_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
loop_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
loop_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
loop_detect
(
const
char
*
path
);
__hidden
extern
int
loop_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
loop_umount
(
struct
lxc_storage
*
bdev
);
#endif
/* __LXC_LOOP_H */
src/lxc/storage/lvm.h
View file @
04c5582a
...
...
@@ -6,28 +6,30 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
bool
lvm_detect
(
const
char
*
path
);
extern
int
lvm_mount
(
struct
lxc_storage
*
bdev
);
extern
int
lvm_umount
(
struct
lxc_storage
*
bdev
);
extern
int
lvm_compare_lv_attr
(
const
char
*
path
,
int
pos
,
const
char
expected
);
extern
int
lvm_is_thin_volume
(
const
char
*
path
);
extern
int
lvm_is_thin_pool
(
const
char
*
path
);
extern
int
lvm_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
lvm_destroy
(
struct
lxc_storage
*
orig
);
extern
int
lvm_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
bool
lvm_create_clone
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
extern
bool
lvm_create_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
bool
lvm_detect
(
const
char
*
path
);
__hidden
extern
int
lvm_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
lvm_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
lvm_compare_lv_attr
(
const
char
*
path
,
int
pos
,
const
char
expected
);
__hidden
extern
int
lvm_is_thin_volume
(
const
char
*
path
);
__hidden
extern
int
lvm_is_thin_pool
(
const
char
*
path
);
__hidden
extern
int
lvm_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
lvm_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
int
lvm_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
bool
lvm_create_clone
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
bool
lvm_create_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
#endif
/* __LXC_LVM_H */
src/lxc/storage/nbd.h
View file @
04c5582a
...
...
@@ -6,25 +6,26 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
int
nbd_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
nbd_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
nbd_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
nbd_detect
(
const
char
*
path
);
extern
int
nbd_mount
(
struct
lxc_storage
*
bdev
);
extern
int
nbd_umount
(
struct
lxc_storage
*
bdev
);
extern
bool
attach_nbd
(
char
*
src
,
struct
lxc_conf
*
conf
);
extern
void
detach_nbd_idx
(
int
idx
);
extern
bool
requires_nbd
(
const
char
*
path
);
__hidden
extern
int
nbd_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
nbd_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
nbd_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
nbd_detect
(
const
char
*
path
);
__hidden
extern
int
nbd_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
nbd_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
bool
attach_nbd
(
char
*
src
,
struct
lxc_conf
*
conf
);
__hidden
extern
void
detach_nbd_idx
(
int
idx
);
__hidden
extern
bool
requires_nbd
(
const
char
*
path
);
#endif
/* __LXC_NBD_H */
src/lxc/storage/overlay.h
View file @
04c5582a
...
...
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "compiler.h"
#include "storage.h"
struct
lxc_storage
;
...
...
@@ -20,16 +21,16 @@ struct lxc_conf;
struct
lxc_rootfs
;
extern
int
ovl_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
ovl_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
ovl_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
ovl_detect
(
const
char
*
path
);
extern
int
ovl_mount
(
struct
lxc_storage
*
bdev
);
extern
int
ovl_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
ovl_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
ovl_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
ovl_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
ovl_detect
(
const
char
*
path
);
__hidden
extern
int
ovl_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
ovl_umount
(
struct
lxc_storage
*
bdev
);
/* To be called from lxcapi_clone() in lxccontainer.c: When we clone a container
* with overlay lxc.mount.entry entries we need to update absolute paths for
...
...
@@ -38,24 +39,23 @@ extern int ovl_umount(struct lxc_storage *bdev);
* independent of each other since lxc_conf->mountlist may container more mount
* entries (e.g. from other included files) than lxc_conf->unexpanded_config .
*/
extern
int
ovl_update_abs_paths
(
struct
lxc_conf
*
lxc_conf
,
const
char
*
lxc_path
,
const
char
*
lxc_name
,
const
char
*
newpath
,
const
char
*
newname
);
__hidden
extern
int
ovl_update_abs_paths
(
struct
lxc_conf
*
lxc_conf
,
const
char
*
lxc_path
,
const
char
*
lxc_name
,
const
char
*
newpath
,
const
char
*
newname
);
/* To be called from functions in lxccontainer.c: Get lower directory for
* overlay rootfs.
*/
extern
const
char
*
ovl_get_lower
(
const
char
*
rootfs_path
);
__hidden
extern
const
char
*
ovl_get_lower
(
const
char
*
rootfs_path
);
/* Get rootfs path for overlay backed containers. Allocated memory must be freed
* by caller.
*/
extern
char
*
ovl_get_rootfs
(
const
char
*
rootfs_path
,
size_t
*
rootfslen
);
__hidden
extern
char
*
ovl_get_rootfs
(
const
char
*
rootfs_path
,
size_t
*
rootfslen
);
/* Create upper- and workdirs for overlay mounts.
*/
extern
int
ovl_mkdir
(
const
struct
mntent
*
mntent
,
const
struct
lxc_rootfs
*
rootfs
,
const
char
*
lxc_name
,
const
char
*
lxc_path
);
__hidden
extern
int
ovl_mkdir
(
const
struct
mntent
*
mntent
,
const
struct
lxc_rootfs
*
rootfs
,
const
char
*
lxc_name
,
const
char
*
lxc_path
);
#endif
/* __LXC_OVERLAY_H */
src/lxc/storage/rbd.h
View file @
04c5582a
...
...
@@ -6,21 +6,23 @@
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
int
rbd_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
rbd_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
rbd_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
rbd_detect
(
const
char
*
path
);
extern
int
rbd_mount
(
struct
lxc_storage
*
bdev
);
extern
int
rbd_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
rbd_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
rbd_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
rbd_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
rbd_detect
(
const
char
*
path
);
__hidden
extern
int
rbd_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
rbd_umount
(
struct
lxc_storage
*
bdev
);
#endif
/* __LXC_RDB_H */
src/lxc/storage/rsync.h
View file @
04c5582a
...
...
@@ -5,6 +5,8 @@
#include <stdio.h>
#include "compiler.h"
struct
rsync_data
{
struct
lxc_storage
*
orig
;
struct
lxc_storage
*
new
;
...
...
@@ -16,9 +18,9 @@ struct rsync_data_char {
};
/* new helpers */
extern
int
lxc_rsync_exec_wrapper
(
void
*
data
);
extern
int
lxc_storage_rsync_exec_wrapper
(
void
*
data
);
extern
int
lxc_rsync_exec
(
const
char
*
src
,
const
char
*
dest
);
extern
int
lxc_rsync
(
struct
rsync_data
*
data
);
__hidden
extern
int
lxc_rsync_exec_wrapper
(
void
*
data
);
__hidden
extern
int
lxc_storage_rsync_exec_wrapper
(
void
*
data
);
__hidden
extern
int
lxc_rsync_exec
(
const
char
*
src
,
const
char
*
dest
);
__hidden
extern
int
lxc_rsync
(
struct
rsync_data
*
data
);
#endif
/* __LXC_RSYNC_H */
src/lxc/storage/storage.h
View file @
04c5582a
...
...
@@ -14,6 +14,8 @@
#include <mntent.h>
#endif
#include "compiler.h"
#ifndef MS_DIRSYNC
#define MS_DIRSYNC 128
#endif
...
...
@@ -99,23 +101,19 @@ struct lxc_storage {
* type specifications. If the <storage type> prefix is not
* detected liblxc will try to detect the storage type.
*/
extern
bool
storage_is_dir
(
struct
lxc_conf
*
conf
);
extern
bool
storage_can_backup
(
struct
lxc_conf
*
conf
);
extern
struct
lxc_storage
*
storage_init
(
struct
lxc_conf
*
conf
);
extern
struct
lxc_storage
*
storage_copy
(
struct
lxc_container
*
c
,
const
char
*
cname
,
const
char
*
lxcpath
,
const
char
*
bdevtype
,
int
flags
,
const
char
*
bdevdata
,
uint64_t
newsize
,
bool
*
needs_rdep
);
extern
struct
lxc_storage
*
storage_create
(
const
char
*
dest
,
const
char
*
type
,
const
char
*
cname
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
void
storage_put
(
struct
lxc_storage
*
bdev
);
extern
bool
storage_destroy
(
struct
lxc_conf
*
conf
);
extern
bool
rootfs_is_blockdev
(
struct
lxc_conf
*
conf
);
extern
const
char
*
lxc_storage_get_path
(
char
*
src
,
const
char
*
prefix
);
__hidden
extern
bool
storage_is_dir
(
struct
lxc_conf
*
conf
);
__hidden
extern
bool
storage_can_backup
(
struct
lxc_conf
*
conf
);
__hidden
extern
struct
lxc_storage
*
storage_init
(
struct
lxc_conf
*
conf
);
__hidden
extern
struct
lxc_storage
*
storage_copy
(
struct
lxc_container
*
c
,
const
char
*
cname
,
const
char
*
lxcpath
,
const
char
*
bdevtype
,
int
flags
,
const
char
*
bdevdata
,
uint64_t
newsize
,
bool
*
needs_rdep
);
__hidden
extern
struct
lxc_storage
*
storage_create
(
const
char
*
dest
,
const
char
*
type
,
const
char
*
cname
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
void
storage_put
(
struct
lxc_storage
*
bdev
);
__hidden
extern
bool
storage_destroy
(
struct
lxc_conf
*
conf
);
__hidden
extern
bool
rootfs_is_blockdev
(
struct
lxc_conf
*
conf
);
__hidden
extern
const
char
*
lxc_storage_get_path
(
char
*
src
,
const
char
*
prefix
);
#endif
/* #define __LXC_STORAGE_H */
src/lxc/storage/storage_utils.h
View file @
04c5582a
...
...
@@ -8,6 +8,7 @@
#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "conf.h"
#include "macro.h"
...
...
@@ -22,20 +23,19 @@
struct
lxc_storage
;
struct
lxc_conf
;
extern
bool
attach_block_device
(
struct
lxc_conf
*
conf
);
extern
void
detach_block_device
(
struct
lxc_conf
*
conf
);
extern
int
blk_getsize
(
struct
lxc_storage
*
bdev
,
uint64_t
*
size
);
extern
int
detect_fs
(
struct
lxc_storage
*
bdev
,
char
*
type
,
int
len
);
extern
int
do_mkfs_exec_wrapper
(
void
*
args
);
extern
int
is_blktype
(
struct
lxc_storage
*
b
);
extern
int
mount_unknown_fs
(
const
char
*
rootfs
,
const
char
*
target
,
const
char
*
options
);
extern
int
find_fstype_cb
(
char
*
buffer
,
void
*
data
);
extern
const
char
*
linkderef
(
const
char
*
path
,
char
*
dest
);
extern
bool
unpriv_snap_allowed
(
struct
lxc_storage
*
b
,
const
char
*
t
,
bool
snap
,
bool
maybesnap
);
extern
uint64_t
get_fssize
(
char
*
s
);
extern
bool
is_valid_storage_type
(
const
char
*
type
);
extern
int
storage_destroy_wrapper
(
void
*
data
);
__hidden
extern
bool
attach_block_device
(
struct
lxc_conf
*
conf
);
__hidden
extern
void
detach_block_device
(
struct
lxc_conf
*
conf
);
__hidden
extern
int
blk_getsize
(
struct
lxc_storage
*
bdev
,
uint64_t
*
size
);
__hidden
extern
int
detect_fs
(
struct
lxc_storage
*
bdev
,
char
*
type
,
int
len
);
__hidden
extern
int
do_mkfs_exec_wrapper
(
void
*
args
);
__hidden
extern
int
is_blktype
(
struct
lxc_storage
*
b
);
__hidden
extern
int
mount_unknown_fs
(
const
char
*
rootfs
,
const
char
*
target
,
const
char
*
options
);
__hidden
extern
int
find_fstype_cb
(
char
*
buffer
,
void
*
data
);
__hidden
extern
const
char
*
linkderef
(
const
char
*
path
,
char
*
dest
);
__hidden
extern
bool
unpriv_snap_allowed
(
struct
lxc_storage
*
b
,
const
char
*
t
,
bool
snap
,
bool
maybesnap
);
__hidden
extern
uint64_t
get_fssize
(
char
*
s
);
__hidden
extern
bool
is_valid_storage_type
(
const
char
*
type
);
__hidden
extern
int
storage_destroy_wrapper
(
void
*
data
);
#endif
/* __LXC_STORAGE_UTILS_H */
src/lxc/storage/zfs.h
View file @
04c5582a
...
...
@@ -7,26 +7,27 @@
#include <stdio.h>
#include <stdint.h>
#include "compiler.h"
struct
lxc_storage
;
struct
bdev_specs
;
struct
lxc_conf
;
extern
int
zfs_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
extern
int
zfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
extern
int
zfs_destroy
(
struct
lxc_storage
*
orig
);
extern
bool
zfs_detect
(
const
char
*
path
);
extern
int
zfs_mount
(
struct
lxc_storage
*
bdev
);
extern
int
zfs_umount
(
struct
lxc_storage
*
bdev
);
extern
bool
zfs_copy
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
extern
bool
zfs_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
int
zfs_clonepaths
(
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
__hidden
extern
int
zfs_create
(
struct
lxc_storage
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
,
const
struct
lxc_conf
*
conf
);
__hidden
extern
int
zfs_destroy
(
struct
lxc_storage
*
orig
);
__hidden
extern
bool
zfs_detect
(
const
char
*
path
);
__hidden
extern
int
zfs_mount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
int
zfs_umount
(
struct
lxc_storage
*
bdev
);
__hidden
extern
bool
zfs_copy
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
__hidden
extern
bool
zfs_snapshot
(
struct
lxc_conf
*
conf
,
struct
lxc_storage
*
orig
,
struct
lxc_storage
*
new
,
uint64_t
newsize
);
#endif
/* __LXC_ZFS_H */
src/tests/Makefile.am
View file @
04c5582a
...
...
@@ -45,6 +45,17 @@ lxc_test_api_reboot_SOURCES = api_reboot.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -81,6 +92,17 @@ lxc_test_apparmor_SOURCES = aa.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -117,6 +139,17 @@ lxc_test_attach_SOURCES = attach.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -154,6 +187,17 @@ lxc_test_cgpath_SOURCES = cgpath.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -193,6 +237,17 @@ lxc_test_config_jump_table_SOURCES = config_jump_table.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -240,6 +295,17 @@ lxc_test_locktests_SOURCES = locktests.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -279,6 +345,17 @@ lxc_test_mount_injection_SOURCES = mount_injection.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -316,6 +393,17 @@ lxc_test_parse_config_file_SOURCES = parse_config_file.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -353,6 +441,17 @@ lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.h
\
...
...
@@ -404,6 +503,17 @@ lxc_test_utils_SOURCES = lxc-test-utils.c \
../lxc/ringbuf.c ../lxc/ringbuf.h
\
../lxc/start.c ../lxc/start.h
\
../lxc/state.c ../lxc/state.h
\
../lxc/storage/btrfs.c ../lxc/storage/btrfs.h
\
../lxc/storage/dir.c ../lxc/storage/dir.h
\
../lxc/storage/loop.c ../lxc/storage/loop.h
\
../lxc/storage/lvm.c ../lxc/storage/lvm.h
\
../lxc/storage/nbd.c ../lxc/storage/nbd.h
\
../lxc/storage/overlay.c ../lxc/storage/overlay.h
\
../lxc/storage/rbd.c ../lxc/storage/rbd.h
\
../lxc/storage/rsync.c ../lxc/storage/rsync.h
\
../lxc/storage/storage.c ../lxc/storage/storage.h
\
../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h
\
../lxc/storage/zfs.c ../lxc/storage/zfs.h
\
../lxc/sync.c ../lxc/sync.h
\
../lxc/string_utils.c ../lxc/string_utils.h
\
../lxc/terminal.c ../lxc/terminal.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