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
d6c06927
Unverified
Commit
d6c06927
authored
Feb 19, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: improve lxc_clear_cgroups()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
15970277
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
conf.c
src/lxc/conf.c
+8
-8
No files found.
src/lxc/conf.c
View file @
d6c06927
...
@@ -3674,17 +3674,17 @@ int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version)
...
@@ -3674,17 +3674,17 @@ int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version)
bool
all
=
false
;
bool
all
=
false
;
if
(
version
==
CGROUP2_SUPER_MAGIC
)
{
if
(
version
==
CGROUP2_SUPER_MAGIC
)
{
global_token
=
"lxc.cgroup2"
;
global_token
=
"lxc.cgroup2"
;
namespaced_token
=
"lxc.cgroup2."
;
namespaced_token
=
"lxc.cgroup2."
;
namespaced_token_len
=
STRLITERALLEN
(
"lxc.cgroup2."
);
namespaced_token_len
=
STRLITERALLEN
(
"lxc.cgroup2."
);
list
=
&
c
->
cgroup2
;
list
=
&
c
->
cgroup2
;
}
else
if
(
version
==
CGROUP_SUPER_MAGIC
)
{
}
else
if
(
version
==
CGROUP_SUPER_MAGIC
)
{
global_token
=
"lxc.cgroup"
;
global_token
=
"lxc.cgroup"
;
namespaced_token
=
"lxc.cgroup."
;
namespaced_token
=
"lxc.cgroup."
;
namespaced_token_len
=
STRLITERALLEN
(
"lxc.cgroup."
);
namespaced_token_len
=
STRLITERALLEN
(
"lxc.cgroup."
);
list
=
&
c
->
cgroup
;
list
=
&
c
->
cgroup
;
}
else
{
}
else
{
return
-
EINVAL
;
return
ret_errno
(
EINVAL
)
;
}
}
if
(
strequal
(
key
,
global_token
))
if
(
strequal
(
key
,
global_token
))
...
@@ -3692,7 +3692,7 @@ int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version)
...
@@ -3692,7 +3692,7 @@ int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version)
else
if
(
strnequal
(
key
,
namespaced_token
,
namespaced_token_len
))
else
if
(
strnequal
(
key
,
namespaced_token
,
namespaced_token_len
))
k
+=
namespaced_token_len
;
k
+=
namespaced_token_len
;
else
else
return
-
EINVAL
;
return
ret_errno
(
EINVAL
)
;
lxc_list_for_each_safe
(
it
,
list
,
next
)
{
lxc_list_for_each_safe
(
it
,
list
,
next
)
{
struct
lxc_cgroup
*
cg
=
it
->
elem
;
struct
lxc_cgroup
*
cg
=
it
->
elem
;
...
...
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