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
411ac6d8
Unverified
Commit
411ac6d8
authored
Oct 31, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups/cgfsng: keep mountpoint intact
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
da3dcce6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
cgfsng.c
src/lxc/cgroups/cgfsng.c
+15
-4
No files found.
src/lxc/cgroups/cgfsng.c
View file @
411ac6d8
...
@@ -760,9 +760,10 @@ static char **get_controllers(char **klist, char **nlist, char *line)
...
@@ -760,9 +760,10 @@ static char **get_controllers(char **klist, char **nlist, char *line)
{
{
/* the fourth field is /sys/fs/cgroup/comma-delimited-controller-list */
/* the fourth field is /sys/fs/cgroup/comma-delimited-controller-list */
int
i
;
int
i
;
char
*
p
=
line
,
*
p2
,
*
tok
,
*
saveptr
=
NULL
;
char
*
dup
,
*
p2
,
*
tok
;
char
**
aret
=
NULL
;
bool
is_cgroup_v2
;
bool
is_cgroup_v2
;
char
*
p
=
line
,
*
saveptr
=
NULL
;
char
**
aret
=
NULL
;
/* handle cgroup v2 */
/* handle cgroup v2 */
is_cgroup_v2
=
is_cgroupfs_v2
(
line
);
is_cgroup_v2
=
is_cgroupfs_v2
(
line
);
...
@@ -792,14 +793,24 @@ static char **get_controllers(char **klist, char **nlist, char *line)
...
@@ -792,14 +793,24 @@ static char **get_controllers(char **klist, char **nlist, char *line)
/* cgroup v2 does not have separate mountpoints for controllers */
/* cgroup v2 does not have separate mountpoints for controllers */
if
(
is_cgroup_v2
)
{
if
(
is_cgroup_v2
)
{
must_append_controller
(
klist
,
nlist
,
&
aret
,
"cgroup2"
);
must_append_controller
(
klist
,
nlist
,
&
aret
,
"cgroup2"
);
return
aret
;
return
NULL
;
}
/* strdup() here for v1 hierarchies. Otherwise strtok_r() will destroy
* mountpoints such as "/sys/fs/cgroup/cpu,cpuacct".
*/
dup
=
strdup
(
p
);
if
(
!
dup
)
{
SYSERROR
(
"Failed to duplicate string"
);
return
NULL
;
}
}
for
(
tok
=
strtok_r
(
p
,
","
,
&
saveptr
);
tok
;
for
(
tok
=
strtok_r
(
du
p
,
","
,
&
saveptr
);
tok
;
tok
=
strtok_r
(
NULL
,
","
,
&
saveptr
))
{
tok
=
strtok_r
(
NULL
,
","
,
&
saveptr
))
{
must_append_controller
(
klist
,
nlist
,
&
aret
,
tok
);
must_append_controller
(
klist
,
nlist
,
&
aret
,
tok
);
}
}
free
(
dup
);
return
aret
;
return
aret
;
}
}
...
...
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