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
1537e2c3
Unverified
Commit
1537e2c3
authored
Sep 10, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: s/base_cgroup/container_base_path/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
984dec41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
cgfsng.c
src/lxc/cgroups/cgfsng.c
+9
-9
cgroup.c
src/lxc/cgroups/cgroup.c
+1
-1
cgroup.h
src/lxc/cgroups/cgroup.h
+2
-2
No files found.
src/lxc/cgroups/cgfsng.c
View file @
1537e2c3
...
...
@@ -573,7 +573,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
if
(
slash
)
*
slash
=
'\0'
;
cgpath
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
cgname
,
NULL
);
cgpath
=
must_make_path
(
h
->
mountpoint
,
h
->
container_base_path
,
cgname
,
NULL
);
if
(
slash
)
*
slash
=
'/'
;
...
...
@@ -810,7 +810,7 @@ static char **cg_unified_get_controllers(const char *file)
}
static
struct
hierarchy
*
add_hierarchy
(
struct
hierarchy
***
h
,
char
**
clist
,
char
*
mountpoint
,
char
*
base_cgroup
,
int
type
)
char
*
container_base_path
,
int
type
)
{
struct
hierarchy
*
new
;
int
newentry
;
...
...
@@ -818,7 +818,7 @@ static struct hierarchy *add_hierarchy(struct hierarchy ***h, char **clist, char
new
=
must_alloc
(
sizeof
(
*
new
));
new
->
controllers
=
clist
;
new
->
mountpoint
=
mountpoint
;
new
->
base_cgroup
=
base_cgroup
;
new
->
container_base_path
=
container_base_path
;
new
->
container_full_path
=
NULL
;
new
->
version
=
type
;
...
...
@@ -1015,7 +1015,7 @@ static void lxc_cgfsng_print_hierarchies(struct cgroup_ops *ops)
int
j
;
char
**
cit
;
TRACE
(
" %d: base_cgroup: %s"
,
i
,
(
*
it
)
->
base_cgroup
?
(
*
it
)
->
base_cgroup
:
"(null)"
);
TRACE
(
" %d: base_cgroup: %s"
,
i
,
(
*
it
)
->
container_base_path
?
(
*
it
)
->
container_base_path
:
"(null)"
);
TRACE
(
" mountpoint: %s"
,
(
*
it
)
->
mountpoint
?
(
*
it
)
->
mountpoint
:
"(null)"
);
TRACE
(
" controllers:"
);
for
(
j
=
0
,
cit
=
(
*
it
)
->
controllers
;
cit
&&
*
cit
;
cit
++
,
j
++
)
...
...
@@ -1167,7 +1167,7 @@ static bool cg_unified_create_cgroup(struct hierarchy *h, char *cgname)
if
(
parts_len
>
0
)
parts_len
--
;
cgroup
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
NULL
);
cgroup
=
must_make_path
(
h
->
mountpoint
,
h
->
container_base_path
,
NULL
);
for
(
i
=
0
;
i
<
parts_len
;
i
++
)
{
int
ret
;
char
*
target
;
...
...
@@ -1196,7 +1196,7 @@ static bool create_path_for_hierarchy(struct hierarchy *h, char *cgname)
{
int
ret
;
h
->
container_full_path
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
cgname
,
NULL
);
h
->
container_full_path
=
must_make_path
(
h
->
mountpoint
,
h
->
container_base_path
,
cgname
,
NULL
);
if
(
dir_exists
(
h
->
container_full_path
))
{
ERROR
(
"The cgroup
\"
%s
\"
already existed"
,
h
->
container_full_path
);
return
false
;
...
...
@@ -1498,7 +1498,7 @@ static int cg_legacy_mount_controllers(int type, struct hierarchy *h,
INFO
(
"Remounted %s read-only"
,
controllerpath
);
}
sourcepath
=
must_make_path
(
h
->
mountpoint
,
h
->
base_cgroup
,
sourcepath
=
must_make_path
(
h
->
mountpoint
,
h
->
container_base_path
,
container_cgroup
,
NULL
);
if
(
type
==
LXC_AUTO_CGROUP_RO
)
flags
|=
MS_RDONLY
;
...
...
@@ -1669,7 +1669,7 @@ __cgfsng_ops__ static bool cgfsng_mount(struct cgroup_ops *ops,
continue
;
}
path2
=
must_make_path
(
controllerpath
,
h
->
base_cgroup
,
path2
=
must_make_path
(
controllerpath
,
h
->
container_base_path
,
ops
->
container_cgroup
,
NULL
);
ret
=
mkdir_p
(
path2
,
0755
);
if
(
ret
<
0
)
{
...
...
@@ -1761,7 +1761,7 @@ __cgfsng_ops__ static bool cgfsng_escape(const struct cgroup_ops *ops)
char
*
fullpath
;
fullpath
=
must_make_path
(
ops
->
hierarchies
[
i
]
->
mountpoint
,
ops
->
hierarchies
[
i
]
->
base_cgroup
,
ops
->
hierarchies
[
i
]
->
container_base_path
,
"cgroup.procs"
,
NULL
);
ret
=
lxc_write_to_file
(
fullpath
,
"0"
,
2
,
false
,
0666
);
if
(
ret
!=
0
)
{
...
...
src/lxc/cgroups/cgroup.c
View file @
1537e2c3
...
...
@@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free
((
*
it
)
->
controllers
);
free
((
*
it
)
->
mountpoint
);
free
((
*
it
)
->
base_cgroup
);
free
((
*
it
)
->
container_base_path
);
free
((
*
it
)
->
container_full_path
);
free
(
*
it
);
}
...
...
src/lxc/cgroups/cgroup.h
View file @
1537e2c3
...
...
@@ -57,7 +57,7 @@ typedef enum {
* depending on whether this is a hybrid cgroup layout (mix of legacy and
* unified hierarchies) or a pure unified cgroup layout.
*
* @
base_cgroup
* @
container_base_path
* - The cgroup under which the container cgroup path
* is created. This will be either the caller's cgroup (if not root), or
* init's cgroup (if root).
...
...
@@ -76,7 +76,7 @@ typedef enum {
struct
hierarchy
{
char
**
controllers
;
char
*
mountpoint
;
char
*
base_cgroup
;
char
*
container_base_path
;
char
*
container_full_path
;
int
version
;
};
...
...
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