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
1bc60a65
Commit
1bc60a65
authored
Oct 09, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use configuration structure for the mount points
Do not use the directory configuration for the mount points. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
d852c78c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
28 deletions
+8
-28
conf.c
src/lxc/conf.c
+8
-28
No files found.
src/lxc/conf.c
View file @
1bc60a65
...
@@ -605,20 +605,6 @@ static int configure_rootfs(const char *name, const char *rootfs)
...
@@ -605,20 +605,6 @@ static int configure_rootfs(const char *name, const char *rootfs)
return
-
1
;
return
-
1
;
}
}
static
int
configure_mount
(
const
char
*
name
,
const
char
*
fstab
)
{
char
path
[
MAXPATHLEN
];
snprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s/fstab"
,
name
);
if
(
lxc_copy_file
(
fstab
,
path
))
{
ERROR
(
"failed to copy the fstab file"
);
return
-
1
;
}
return
0
;
}
static
int
unconfigure_ip_addresses
(
const
char
*
directory
)
static
int
unconfigure_ip_addresses
(
const
char
*
directory
)
{
{
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
...
@@ -1059,26 +1045,25 @@ static int parse_mntopts(struct mntent *mntent, unsigned long *mntflags,
...
@@ -1059,26 +1045,25 @@ static int parse_mntopts(struct mntent *mntent, unsigned long *mntflags,
return
0
;
return
0
;
}
}
static
int
setup_mount
(
const
char
*
name
)
static
int
setup_mount
(
const
char
*
fstab
)
{
{
char
path
[
MAXPATHLEN
];
struct
mntent
*
mntent
;
struct
mntent
*
mntent
;
FILE
*
file
;
FILE
*
file
;
int
ret
=
-
1
;
int
ret
=
-
1
;
unsigned
long
mntflags
;
unsigned
long
mntflags
;
char
*
mntdata
;
char
*
mntdata
;
snprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s/fstab"
,
name
);
if
(
!
fstab
)
return
0
;
file
=
setmntent
(
path
,
"r"
);
file
=
setmntent
(
fstab
,
"r"
);
if
(
!
file
)
{
if
(
!
file
)
{
if
(
errno
==
ENOENT
)
SYSERROR
(
"failed to use '%s'"
,
fstab
);
return
0
;
return
-
1
;
SYSERROR
(
"failed to open '%s'"
,
path
);
goto
out
;
}
}
while
((
mntent
=
getmntent
(
file
)))
{
while
((
mntent
=
getmntent
(
file
)))
{
mntflags
=
0
;
mntflags
=
0
;
mntdata
=
NULL
;
mntdata
=
NULL
;
if
(
parse_mntopts
(
mntent
,
&
mntflags
,
&
mntdata
)
<
0
)
{
if
(
parse_mntopts
(
mntent
,
&
mntflags
,
&
mntdata
)
<
0
)
{
...
@@ -1398,11 +1383,6 @@ int lxc_configure(const char *name, struct lxc_conf *conf)
...
@@ -1398,11 +1383,6 @@ int lxc_configure(const char *name, struct lxc_conf *conf)
return
-
1
;
return
-
1
;
}
}
if
(
conf
->
fstab
&&
configure_mount
(
name
,
conf
->
fstab
))
{
ERROR
(
"failed to configure the mount points"
);
return
-
1
;
}
return
0
;
return
0
;
}
}
...
@@ -1804,7 +1784,7 @@ int lxc_setup(const char *name, const char *cons,
...
@@ -1804,7 +1784,7 @@ int lxc_setup(const char *name, const char *cons,
return
-
1
;
return
-
1
;
}
}
if
(
lxc_conf
.
fstab
&&
setup_mount
(
name
))
{
if
(
setup_mount
(
lxc_conf
.
fstab
))
{
ERROR
(
"failed to setup the mounts for '%s'"
,
name
);
ERROR
(
"failed to setup the mounts for '%s'"
,
name
);
return
-
1
;
return
-
1
;
}
}
...
...
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