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
16ec15b2
Commit
16ec15b2
authored
Mar 17, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #899 from hallyn/2016-03-16/cgroupauto.2
cgfsng: include sys/mount.h
parents
3860edcb
5b6f9369
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
cgfsng.c
src/lxc/cgfsng.c
+6
-3
No files found.
src/lxc/cgfsng.c
View file @
16ec15b2
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
#include "cgroup.h"
#include "cgroup.h"
#include "utils.h"
#include "utils.h"
#include "commands.h"
#include "commands.h"
#include "bdev/bdev.h"
lxc_log_define
(
lxc_cgfsng
,
lxc
);
lxc_log_define
(
lxc_cgfsng
,
lxc
);
...
@@ -1237,7 +1238,9 @@ static int mount_cgroup_full(int type, struct hierarchy *h, char *dest,
...
@@ -1237,7 +1238,9 @@ static int mount_cgroup_full(int type, struct hierarchy *h, char *dest,
return
-
1
;
return
-
1
;
}
}
if
(
type
!=
LXC_AUTO_CGROUP_FULL_RW
)
{
if
(
type
!=
LXC_AUTO_CGROUP_FULL_RW
)
{
if
(
mount
(
NULL
,
dest
,
"cgroup"
,
MS_BIND
|
MS_REMOUNT
|
MS_RDONLY
,
NULL
)
<
0
)
{
unsigned
long
flags
=
MS_BIND
|
MS_NOSUID
|
MS_NOEXEC
|
MS_NODEV
|
MS_REMOUNT
|
MS_RDONLY
;
if
(
mount
(
NULL
,
dest
,
"cgroup"
,
flags
,
NULL
)
<
0
)
{
SYSERROR
(
"Error remounting %s readonly"
,
dest
);
SYSERROR
(
"Error remounting %s readonly"
,
dest
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1249,7 +1252,7 @@ static int mount_cgroup_full(int type, struct hierarchy *h, char *dest,
...
@@ -1249,7 +1252,7 @@ static int mount_cgroup_full(int type, struct hierarchy *h, char *dest,
/* mount just the container path rw */
/* mount just the container path rw */
char
*
source
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
container_cgroup
,
NULL
);
char
*
source
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
container_cgroup
,
NULL
);
char
*
rwpath
=
must_make_path
(
dest
,
container_cgroup
,
NULL
);
char
*
rwpath
=
must_make_path
(
dest
,
h
->
base_cgroup
,
container_cgroup
,
NULL
);
if
(
mount
(
source
,
rwpath
,
"cgroup"
,
MS_BIND
,
NULL
)
<
0
)
if
(
mount
(
source
,
rwpath
,
"cgroup"
,
MS_BIND
,
NULL
)
<
0
)
WARN
(
"Failed to mount %s read-write: %m"
,
rwpath
);
WARN
(
"Failed to mount %s read-write: %m"
,
rwpath
);
INFO
(
"Made %s read-write"
,
rwpath
);
INFO
(
"Made %s read-write"
,
rwpath
);
...
@@ -1358,7 +1361,7 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
...
@@ -1358,7 +1361,7 @@ static bool cgfsng_mount(void *hdata, const char *root, int type)
free
(
controllerpath
);
free
(
controllerpath
);
continue
;
continue
;
}
}
path2
=
must_make_path
(
controllerpath
,
d
->
container_cgroup
,
NULL
);
path2
=
must_make_path
(
controllerpath
,
h
->
base_cgroup
,
d
->
container_cgroup
,
NULL
);
if
(
mkdir_p
(
path2
,
0755
)
<
0
)
{
if
(
mkdir_p
(
path2
,
0755
)
<
0
)
{
free
(
controllerpath
);
free
(
controllerpath
);
goto
bad
;
goto
bad
;
...
...
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