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
47148e96
Unverified
Commit
47148e96
authored
Jul 02, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: lxc.mount --> lxc.mount.fstab
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3aed4934
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
17 deletions
+36
-17
lxc.container.conf
doc/lxc.container.conf
+1
-1
lxc.container.conf.sgml.in
doc/lxc.container.conf.sgml.in
+2
-2
confile.c
src/lxc/confile.c
+14
-9
lxccontainer.c
src/lxc/lxccontainer.c
+6
-1
parse_config_file.c
src/tests/parse_config_file.c
+10
-1
lxc-download.in
templates/lxc-download.in
+1
-1
lxc-pld.in
templates/lxc-pld.in
+1
-1
lxc-slackware.in
templates/lxc-slackware.in
+1
-1
No files found.
doc/lxc.container.conf
View file @
47148e96
# the fstab mount file
# the fstab mount file
lxc
.
mount
= ./
fstab
lxc
.
mount
.
fstab
= ./
fstab
# the hostname to be set into the container
# the hostname to be set into the container
lxc
.
utsname
=
virtnode
lxc
.
utsname
=
virtnode
...
...
doc/lxc.container.conf.sgml.in
View file @
47148e96
...
@@ -815,7 +815,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
...
@@ -815,7 +815,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
<term>
<option>lxc.mount</option>
<option>lxc.mount
.fstab
</option>
</term>
</term>
<listitem>
<listitem>
<para>
<para>
...
@@ -1987,7 +1987,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
...
@@ -1987,7 +1987,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
lxc.cgroup.devices.deny = a
lxc.cgroup.devices.deny = a
lxc.cgroup.devices.allow = c 1:3 rw
lxc.cgroup.devices.allow = c 1:3 rw
lxc.cgroup.devices.allow = b 8:0 rw
lxc.cgroup.devices.allow = b 8:0 rw
lxc.mount = /etc/fstab.complex
lxc.mount
.fstab
= /etc/fstab.complex
lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
lxc.mount.entry = /lib /root/myrootfs/lib none ro,bind 0 0
lxc.rootfs.path = dir:/mnt/rootfs.complex
lxc.rootfs.path = dir:/mnt/rootfs.complex
lxc.cap.drop = sys_module mknod setuid net_raw
lxc.cap.drop = sys_module mknod setuid net_raw
...
...
src/lxc/confile.c
View file @
47148e96
...
@@ -87,7 +87,7 @@ lxc_config_define(log_level);
...
@@ -87,7 +87,7 @@ lxc_config_define(log_level);
lxc_config_define
(
log_file
);
lxc_config_define
(
log_file
);
lxc_config_define
(
mount
);
lxc_config_define
(
mount
);
lxc_config_define
(
mount_auto
);
lxc_config_define
(
mount_auto
);
lxc_config_define
(
fstab
);
lxc_config_define
(
mount_
fstab
);
lxc_config_define
(
rootfs_mount
);
lxc_config_define
(
rootfs_mount
);
lxc_config_define
(
rootfs_options
);
lxc_config_define
(
rootfs_options
);
lxc_config_define
(
rootfs_backend
);
lxc_config_define
(
rootfs_backend
);
...
@@ -159,12 +159,17 @@ static struct lxc_config_t config[] = {
...
@@ -159,12 +159,17 @@ static struct lxc_config_t config[] = {
{
"lxc.id_map"
,
set_config_idmaps
,
get_config_idmaps
,
clr_config_idmaps
,
},
{
"lxc.id_map"
,
set_config_idmaps
,
get_config_idmaps
,
clr_config_idmaps
,
},
{
"lxc.mount.entry"
,
set_config_mount
,
get_config_mount
,
clr_config_mount
,
},
{
"lxc.mount.entry"
,
set_config_mount
,
get_config_mount
,
clr_config_mount
,
},
{
"lxc.mount.auto"
,
set_config_mount_auto
,
get_config_mount_auto
,
clr_config_mount_auto
,
},
{
"lxc.mount.auto"
,
set_config_mount_auto
,
get_config_mount_auto
,
clr_config_mount_auto
,
},
{
"lxc.mount
"
,
set_config_fstab
,
get_config_fstab
,
clr_config_fstab
,
},
{
"lxc.mount
.fstab"
,
set_config_mount_fstab
,
get_config_mount_fstab
,
clr_config_mount_fstab
,
},
{
"lxc.rootfs.mount"
,
set_config_rootfs_mount
,
get_config_rootfs_mount
,
clr_config_rootfs_mount
,
},
{
"lxc.rootfs.mount"
,
set_config_rootfs_mount
,
get_config_rootfs_mount
,
clr_config_rootfs_mount
,
},
{
"lxc.rootfs.options"
,
set_config_rootfs_options
,
get_config_rootfs_options
,
clr_config_rootfs_options
,
},
{
"lxc.rootfs.options"
,
set_config_rootfs_options
,
get_config_rootfs_options
,
clr_config_rootfs_options
,
},
{
"lxc.rootfs.path"
,
set_config_rootfs_path
,
get_config_rootfs_path
,
clr_config_rootfs_path
,
},
{
"lxc.rootfs.path"
,
set_config_rootfs_path
,
get_config_rootfs_path
,
clr_config_rootfs_path
,
},
/* REMOVE IN LXC 3.0
/* REMOVE IN LXC 3.0
legacy mount key
*/
{
"lxc.mount"
,
set_config_mount_fstab
,
get_config_mount_fstab
,
clr_config_mount_fstab
,
},
/* REMOVE IN LXC 3.0
legacy rootfs.backend key
legacy rootfs.backend key
*/
*/
{
"lxc.rootfs.backend"
,
set_config_rootfs_backend
,
get_config_rootfs_backend
,
clr_config_rootfs_backend
,
},
{
"lxc.rootfs.backend"
,
set_config_rootfs_backend
,
get_config_rootfs_backend
,
clr_config_rootfs_backend
,
},
...
@@ -1739,11 +1744,11 @@ on_error:
...
@@ -1739,11 +1744,11 @@ on_error:
return
-
1
;
return
-
1
;
}
}
static
int
set_config_fstab
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_
mount_
fstab
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
if
(
lxc_config_value_empty
(
value
))
{
if
(
lxc_config_value_empty
(
value
))
{
clr_config_fstab
(
key
,
lxc_conf
,
NULL
);
clr_config_
mount_
fstab
(
key
,
lxc_conf
,
NULL
);
return
-
1
;
return
-
1
;
}
}
...
@@ -2926,8 +2931,8 @@ static int get_config_log_file(const char *key, char *retv, int inlen,
...
@@ -2926,8 +2931,8 @@ static int get_config_log_file(const char *key, char *retv, int inlen,
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
logfile
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
logfile
);
}
}
static
int
get_config_fstab
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
static
int
get_config_
mount_
fstab
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
struct
lxc_conf
*
c
,
void
*
data
)
{
{
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
fstab
);
return
lxc_get_conf_str
(
retv
,
inlen
,
c
->
fstab
);
}
}
...
@@ -3441,8 +3446,8 @@ static inline int clr_config_mount_auto(const char *key, struct lxc_conf *c,
...
@@ -3441,8 +3446,8 @@ static inline int clr_config_mount_auto(const char *key, struct lxc_conf *c,
return
lxc_clear_automounts
(
c
);
return
lxc_clear_automounts
(
c
);
}
}
static
inline
int
clr_config_fstab
(
const
char
*
key
,
struct
lxc_conf
*
c
,
static
inline
int
clr_config_
mount_
fstab
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
void
*
data
)
{
{
free
(
c
->
fstab
);
free
(
c
->
fstab
);
c
->
fstab
=
NULL
;
c
->
fstab
=
NULL
;
...
...
src/lxc/lxccontainer.c
View file @
47148e96
...
@@ -2803,8 +2803,13 @@ static int copy_fstab(struct lxc_container *oldc, struct lxc_container *c)
...
@@ -2803,8 +2803,13 @@ static int copy_fstab(struct lxc_container *oldc, struct lxc_container *c)
if
(
!
oldpath
)
if
(
!
oldpath
)
return
0
;
return
0
;
/* REMOVE IN LXC 3.0
legacy mount key
*/
clear_unexp_config_line
(
c
->
lxc_conf
,
"lxc.mount"
,
false
);
clear_unexp_config_line
(
c
->
lxc_conf
,
"lxc.mount"
,
false
);
clear_unexp_config_line
(
c
->
lxc_conf
,
"lxc.mount.fstab"
,
false
);
char
*
p
=
strrchr
(
oldpath
,
'/'
);
char
*
p
=
strrchr
(
oldpath
,
'/'
);
if
(
!
p
)
if
(
!
p
)
return
-
1
;
return
-
1
;
...
@@ -2829,7 +2834,7 @@ static int copy_fstab(struct lxc_container *oldc, struct lxc_container *c)
...
@@ -2829,7 +2834,7 @@ static int copy_fstab(struct lxc_container *oldc, struct lxc_container *c)
ERROR
(
"error: allocating pathname"
);
ERROR
(
"error: allocating pathname"
);
return
-
1
;
return
-
1
;
}
}
if
(
!
do_append_unexp_config_line
(
c
->
lxc_conf
,
"lxc.mount"
,
newpath
))
{
if
(
!
do_append_unexp_config_line
(
c
->
lxc_conf
,
"lxc.mount
.fstab
"
,
newpath
))
{
ERROR
(
"error saving new lxctab"
);
ERROR
(
"error saving new lxctab"
);
return
-
1
;
return
-
1
;
}
}
...
...
src/tests/parse_config_file.c
View file @
47148e96
...
@@ -473,13 +473,22 @@ int main(int argc, char *argv[])
...
@@ -473,13 +473,22 @@ int main(int argc, char *argv[])
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.mount */
/* REMOVE IN LXC 3.0
legacy lxc.mount key
*/
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.mount"
,
"/some/path"
,
NULL
,
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.mount"
,
"/some/path"
,
NULL
,
true
)
<
0
)
{
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.mount"
);
lxc_error
(
"%s
\n
"
,
"lxc.mount"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.mount.fstab */
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.mount.fstab"
,
"/some/path"
,
NULL
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.mount.fstab"
);
goto
non_test_error
;
}
/* lxc.mount.auto
/* lxc.mount.auto
* Note that we cannot compare the values since the getter for
* Note that we cannot compare the values since the getter for
* lxc.mount.auto does not preserve ordering.
* lxc.mount.auto does not preserve ordering.
...
...
templates/lxc-download.in
View file @
47148e96
...
@@ -545,7 +545,7 @@ if [ -e "${LXC_PATH}/config-auto" ]; then
...
@@ -545,7 +545,7 @@ if [ -e "${LXC_PATH}/config-auto" ]; then
rm
${
LXC_PATH
}
/config-auto
rm
${
LXC_PATH
}
/config-auto
fi
fi
if
[
-e
"
$fstab
"
]
;
then
if
[
-e
"
$fstab
"
]
;
then
echo
"lxc.mount =
${
LXC_PATH
}
/fstab"
>>
${
LXC_PATH
}
/config
echo
"lxc.mount
.fstab
=
${
LXC_PATH
}
/fstab"
>>
${
LXC_PATH
}
/config
fi
fi
echo
"lxc.uts.name =
${
LXC_NAME
}
"
>>
${
LXC_PATH
}
/config
echo
"lxc.uts.name =
${
LXC_NAME
}
"
>>
${
LXC_PATH
}
/config
...
...
templates/lxc-pld.in
View file @
47148e96
...
@@ -242,7 +242,7 @@ lxc.uts.name = $utsname
...
@@ -242,7 +242,7 @@ lxc.uts.name = $utsname
lxc.tty = 4
lxc.tty = 4
lxc.pts = 1024
lxc.pts = 1024
# Consider if below line is right for systemd container
# Consider if below line is right for systemd container
lxc.mount =
$config_path
/fstab
lxc.mount
.fstab
=
$config_path
/fstab
lxc.cap.drop = sys_module mac_admin mac_override sys_time
lxc.cap.drop = sys_module mac_admin mac_override sys_time
lxc.autodev =
$auto_dev
lxc.autodev =
$auto_dev
...
...
templates/lxc-slackware.in
View file @
47148e96
...
@@ -641,7 +641,7 @@ cat <<EOF >> $path/config
...
@@ -641,7 +641,7 @@ cat <<EOF >> $path/config
lxc.uts.name = $name
lxc.uts.name = $name
lxc.arch = $arch
lxc.arch = $arch
lxc.mount = $rootfs/etc/fstab
lxc.mount
.fstab
= $rootfs/etc/fstab
lxc.include = ${LXC_TEMPLATE_CONFIG}/slackware.common.conf
lxc.include = ${LXC_TEMPLATE_CONFIG}/slackware.common.conf
EOF
EOF
...
...
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