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
f205f10c
Unverified
Commit
f205f10c
authored
Feb 17, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: cg_hybrid_get_controllers()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e1c27ab0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
cgfsng.c
src/lxc/cgroups/cgfsng.c
+12
-10
No files found.
src/lxc/cgroups/cgfsng.c
View file @
f205f10c
...
@@ -854,17 +854,17 @@ static bool all_controllers_found(void)
...
@@ -854,17 +854,17 @@ static bool all_controllers_found(void)
return
true
;
return
true
;
}
}
/*
/* Get the controllers from a mountinfo line There are other ways we could get
* Get the controllers from a mountinfo line
* this info. For lxcfs, field 3 is /cgroup/controller-list. For cgroupfs, we
* There are other ways we could get this info. For lxcfs, field 3
* could parse the mount options. But we simply assume that the mountpoint must
* is /cgroup/controller-list. For cgroupfs, we could parse the mount
* be /sys/fs/cgroup/controller-list
* options. But we simply assume that the mountpoint must be
* /sys/fs/cgroup/controller-list
*/
*/
static
char
**
cg_hybrid_get_controllers
(
char
**
klist
,
char
**
nlist
,
char
*
line
,
static
char
**
cg_hybrid_get_controllers
(
char
**
klist
,
char
**
nlist
,
char
*
line
,
int
type
)
int
type
)
{
{
/* the fourth field is /sys/fs/cgroup/comma-delimited-controller-list */
/* The fourth field is /sys/fs/cgroup/comma-delimited-controller-list
* for legacy hierarchies.
*/
int
i
;
int
i
;
char
*
dup
,
*
p2
,
*
tok
;
char
*
dup
,
*
p2
,
*
tok
;
char
*
p
=
line
,
*
saveptr
=
NULL
,
*
sep
=
","
;
char
*
p
=
line
,
*
saveptr
=
NULL
,
*
sep
=
","
;
...
@@ -877,9 +877,10 @@ static char **cg_hybrid_get_controllers(char **klist, char **nlist, char *line,
...
@@ -877,9 +877,10 @@ static char **cg_hybrid_get_controllers(char **klist, char **nlist, char *line,
p
++
;
p
++
;
}
}
/* note - if we change how mountinfo works, then our caller
/* Note, if we change how mountinfo works, then our caller will need to
* will need to verify /sys/fs/cgroup/ in this field */
* verify /sys/fs/cgroup/ in this field.
if
(
strncmp
(
p
,
"/sys/fs/cgroup/"
,
15
))
{
*/
if
(
strncmp
(
p
,
"/sys/fs/cgroup/"
,
15
)
!=
0
)
{
CGFSNG_DEBUG
(
"Found hierarchy not under /sys/fs/cgroup:
\"
%s
\"\n
"
,
p
);
CGFSNG_DEBUG
(
"Found hierarchy not under /sys/fs/cgroup:
\"
%s
\"\n
"
,
p
);
return
NULL
;
return
NULL
;
}
}
...
@@ -907,6 +908,7 @@ static char **cg_hybrid_get_controllers(char **klist, char **nlist, char *line,
...
@@ -907,6 +908,7 @@ static char **cg_hybrid_get_controllers(char **klist, char **nlist, char *line,
free
(
dup
);
free
(
dup
);
}
}
*
p2
=
' '
;
*
p2
=
' '
;
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