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
185f6ea5
Unverified
Commit
185f6ea5
authored
Jun 04, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bdev: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
67e963fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
27 deletions
+25
-27
bdev.c
src/lxc/bdev/bdev.c
+0
-0
bdev.h
src/lxc/bdev/bdev.h
+25
-27
No files found.
src/lxc/bdev/bdev.c
View file @
185f6ea5
This diff is collapsed.
Click to expand it.
src/lxc/bdev/bdev.h
View file @
185f6ea5
...
...
@@ -23,17 +23,13 @@
#ifndef __LXC_BDEV_H
#define __LXC_BDEV_H
/* blockdev operations for:
* aufs, dir, raw, btrfs, overlayfs, aufs, lvm, loop, zfs, nbd (qcow2, raw, vdi, qed)
*/
#include
<lxc/lxccontainer.h>
#include
"config.h"
#include <stdint.h>
#include <sys/mount.h>
#include
"config.h"
#include
<lxc/lxccontainer.h>
/* define constants if the kernel/glibc headers don't define them */
#ifndef MS_DIRSYNC
#define MS_DIRSYNC 128
#endif
...
...
@@ -71,20 +67,21 @@ struct bdev_ops {
int
(
*
umount
)(
struct
bdev
*
bdev
);
int
(
*
destroy
)(
struct
bdev
*
bdev
);
int
(
*
create
)(
struct
bdev
*
bdev
,
const
char
*
dest
,
const
char
*
n
,
struct
bdev_specs
*
specs
);
struct
bdev_specs
*
specs
);
/* given original mount, rename the paths for cloned container */
int
(
*
clone_paths
)(
struct
bdev
*
orig
,
struct
bdev
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
int
(
*
clone_paths
)(
struct
bdev
*
orig
,
struct
bdev
*
new
,
const
char
*
oldname
,
const
char
*
cname
,
const
char
*
oldpath
,
const
char
*
lxcpath
,
int
snap
,
uint64_t
newsize
,
struct
lxc_conf
*
conf
);
bool
can_snapshot
;
bool
can_backup
;
};
/*
* When lxc-start
(conf.c) is mounting a rootfs, then src will be the
*
'lxc.rootfs' value, dest will be mount dir (i.e. $libdir/lxc) When clone
*
or create is doing so, then dest will be $lxcpath/$lxcname/rootfs, since
*
we may need to rsync from
one to the other.
* When lxc-start
is mounting a rootfs, then src will be the "lxc.rootfs" value,
*
dest will be mount dir (i.e. $libdir/lxc) When clone or create is doing so,
*
then dest will be $lxcpath/$lxcname/rootfs, since we may need to rsync from
* one to the other.
* data is so far unused.
*/
struct
bdev
{
...
...
@@ -93,10 +90,10 @@ struct bdev {
char
*
src
;
char
*
dest
;
char
*
mntopts
;
/
/ turn the following into a union if need be
/
/ lofd is the open fd for the mounted loopback file
/
* Turn the following into a union if need be. */
/
* lofd is the open fd for the mounted loopback file. */
int
lofd
;
/
/ index for the connected nbd device
/
* index for the connected nbd device. */
int
nbd_idx
;
};
...
...
@@ -104,27 +101,27 @@ bool bdev_is_dir(struct lxc_conf *conf, const char *path);
bool
bdev_can_backup
(
struct
lxc_conf
*
conf
);
/*
* Instantiate a bdev object.
The src is used to determine which blockdev
* t
ype this should be. The dst and data are optional, and will be used
*
in case of
mount/umount.
* Instantiate a bdev object.
The src is used to determine which blockdev type
* t
his should be. The dst and data are optional, and will be used in case of
* mount/umount.
*
* Optionally, src can be 'dir:/var/lib/lxc/c1' or 'lvm:/dev/lxc/c1'. For
* other backing stores, this will allow additional options.
In particular,
* other backing stores, this will allow additional options. In particular,
* "overlayfs:/var/lib/lxc/canonical/rootfs:/var/lib/lxc/c1/delta" will mean
* use /var/lib/lxc/canonical/rootfs as lower dir, and /var/lib/lxc/c1/delta
* as the upper, writeable layer.
*/
struct
bdev
*
bdev_init
(
struct
lxc_conf
*
conf
,
const
char
*
src
,
const
char
*
dst
,
const
char
*
data
);
const
char
*
data
);
struct
bdev
*
bdev_copy
(
struct
lxc_container
*
c0
,
const
char
*
cname
,
const
char
*
lxcpath
,
const
char
*
bdevtype
,
int
flags
,
const
char
*
bdevdata
,
uint64_t
newsize
,
int
*
needs_rdep
);
struct
bdev
*
bdev_create
(
const
char
*
dest
,
const
char
*
type
,
const
char
*
cname
,
struct
bdev_specs
*
specs
);
const
char
*
lxcpath
,
const
char
*
bdevtype
,
int
flags
,
const
char
*
bdevdata
,
uint64_t
newsize
,
int
*
needs_rdep
);
struct
bdev
*
bdev_create
(
const
char
*
dest
,
const
char
*
type
,
const
char
*
cname
,
struct
bdev_specs
*
specs
);
void
bdev_put
(
struct
bdev
*
bdev
);
bool
bdev_destroy
(
struct
lxc_conf
*
conf
);
/* callback function to be used with userns_exec_1() */
int
bdev_destroy_wrapper
(
void
*
data
);
...
...
@@ -139,6 +136,7 @@ int is_blktype(struct bdev *b);
int
mount_unknown_fs
(
const
char
*
rootfs
,
const
char
*
target
,
const
char
*
options
);
bool
rootfs_is_blockdev
(
struct
lxc_conf
*
conf
);
/*
* these are really for qemu-nbd support, as container shutdown
* must explicitly request device detach.
...
...
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