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
45581fc7
Unverified
Commit
45581fc7
authored
Dec 03, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: add DEFAULT_MOUNTPOINT #define
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
81eb5018
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
cgfsng.c
src/lxc/cgroups/cgfsng.c
+6
-6
cgroup.h
src/lxc/cgroups/cgroup.h
+3
-0
No files found.
src/lxc/cgroups/cgfsng.c
View file @
45581fc7
...
...
@@ -742,8 +742,8 @@ static char **cg_hybrid_get_controllers(char **klist, char **nlist, char *line,
/* Note, if we change how mountinfo works, then our caller will need to
* verify /sys/fs/cgroup/ in this field.
*/
if
(
strncmp
(
p
,
"/sys/fs/cgroup
/"
,
15
)
!=
0
)
{
ERROR
(
"Found hierarchy not under
/sys/fs/cgroup
:
\"
%s
\"
"
,
p
);
if
(
strncmp
(
p
,
DEFAULT_CGROUP_MOUNTPOINT
"
/"
,
15
)
!=
0
)
{
ERROR
(
"Found hierarchy not under
"
DEFAULT_CGROUP_MOUNTPOINT
"
:
\"
%s
\"
"
,
p
);
return
NULL
;
}
...
...
@@ -844,7 +844,7 @@ static char *cg_hybrid_get_mountpoint(char *line)
p
++
;
}
if
(
strncmp
(
p
,
"/sys/fs/cgroup
/"
,
15
)
!=
0
)
if
(
strncmp
(
p
,
DEFAULT_CGROUP_MOUNTPOINT
"
/"
,
15
)
!=
0
)
return
NULL
;
p2
=
strchr
(
p
+
15
,
' '
);
...
...
@@ -1811,7 +1811,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
else
if
(
type
==
LXC_AUTO_CGROUP_FULL_NOSPEC
)
type
=
LXC_AUTO_CGROUP_FULL_MIXED
;
cgroup_root
=
must_make_path
(
root
,
"/sys/fs/cgroup"
,
NULL
);
cgroup_root
=
must_make_path
(
root
,
DEFAULT_CGROUP_MOUNTPOINT
,
NULL
);
if
(
ops
->
cgroup_layout
==
CGROUP_LAYOUT_UNIFIED
)
{
if
(
has_cgns
&&
wants_force_mount
)
{
/* If cgroup namespaces are supported but the container
...
...
@@ -2953,7 +2953,7 @@ static int cg_is_pure_unified(void)
int
ret
;
struct
statfs
fs
;
ret
=
statfs
(
"/sys/fs/cgroup"
,
&
fs
);
ret
=
statfs
(
DEFAULT_CGROUP_MOUNTPOINT
,
&
fs
);
if
(
ret
<
0
)
return
-
ENOMEDIUM
;
...
...
@@ -3019,7 +3019,7 @@ static int cg_unified_init(struct cgroup_ops *ops, bool relative,
* further down the hierarchy. If not it is up to the user to delegate
* them to us.
*/
mountpoint
=
must_copy_string
(
"/sys/fs/cgroup"
);
mountpoint
=
must_copy_string
(
DEFAULT_CGROUP_MOUNTPOINT
);
subtree_path
=
must_make_path
(
mountpoint
,
base_cgroup
,
"cgroup.subtree_control"
,
NULL
);
delegatable
=
cg_unified_get_controllers
(
subtree_path
);
...
...
src/lxc/cgroups/cgroup.h
View file @
45581fc7
...
...
@@ -28,6 +28,7 @@
#include <stddef.h>
#include <sys/types.h>
#define DEFAULT_CGROUP_MOUNTPOINT "/sys/fs/cgroup"
#define PAYLOAD_CGROUP "lxc.payload"
#define MONITOR_CGROUP "lxc.monitor"
#define PIVOT_CGROUP "lxc.pivot"
...
...
@@ -92,6 +93,8 @@ struct hierarchy {
char
*
container_full_path
;
char
*
monitor_full_path
;
int
version
;
/* cgroup2 only */
int
bpf_device_controller
:
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