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
01ca5357
Unverified
Commit
01ca5357
authored
Jul 29, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: split mount options into flags and data
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
55a8306f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
conf.h
src/lxc/conf.h
+6
-2
confile.c
src/lxc/confile.c
+30
-1
No files found.
src/lxc/conf.h
View file @
01ca5357
...
...
@@ -150,14 +150,18 @@ struct lxc_tty_info {
* optionals pivot_root, rootfs mount paths
* @path : the rootfs source (directory or device)
* @mount : where it is mounted
* @options : mount options
* @bev_type : optional backing store type
* @options : mount options
* @mountflags : the portion of @options that are flags
* @data : the porition of @options that are not flags
*/
struct
lxc_rootfs
{
char
*
path
;
char
*
mount
;
char
*
options
;
char
*
bdev_type
;
char
*
options
;
unsigned
long
mountflags
;
char
*
data
;
};
/*
...
...
src/lxc/confile.c
View file @
01ca5357
...
...
@@ -2024,7 +2024,32 @@ static int set_config_rootfs_mount(const char *key, const char *value,
static
int
set_config_rootfs_options
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
return
set_config_string_item
(
&
lxc_conf
->
rootfs
.
options
,
value
);
int
ret
;
unsigned
long
mflags
=
0
,
pflags
=
0
;
char
*
mdata
=
NULL
,
*
opts
=
NULL
;
struct
lxc_rootfs
*
rootfs
=
&
lxc_conf
->
rootfs
;
ret
=
parse_mntopts
(
value
,
&
mflags
,
&
mdata
);
if
(
ret
<
0
)
return
-
EINVAL
;
ret
=
parse_propagationopts
(
value
,
&
pflags
);
if
(
ret
<
0
)
{
free
(
mdata
);
return
-
EINVAL
;
}
ret
=
set_config_string_item
(
&
opts
,
value
);
if
(
ret
<
0
)
{
free
(
mdata
);
return
-
ENOMEM
;
}
rootfs
->
mountflags
=
mflags
|
pflags
;
rootfs
->
options
=
opts
;
rootfs
->
data
=
mdata
;
return
0
;
}
static
int
set_config_uts_name
(
const
char
*
key
,
const
char
*
value
,
...
...
@@ -3793,6 +3818,10 @@ static inline int clr_config_rootfs_options(const char *key, struct lxc_conf *c,
{
free
(
c
->
rootfs
.
options
);
c
->
rootfs
.
options
=
NULL
;
free
(
c
->
rootfs
.
data
);
c
->
rootfs
.
data
=
NULL
;
return
0
;
}
...
...
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