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
292f9985
Unverified
Commit
292f9985
authored
Feb 24, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: handle fallback gracefully
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
1274eb5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-2
lxccontainer.c
src/lxc/lxccontainer.c
+2
-2
No files found.
src/lxc/cgroups/cgfsng.c
View file @
292f9985
...
...
@@ -3458,7 +3458,7 @@ int cgroup_get(const char *name, const char *lxcpath,
unified_fd
=
lxc_cmd_get_limiting_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
return
ret_errno
(
ENO
CGROUP2
);
return
ret_errno
(
ENO
SYS
);
ret
=
lxc_read_try_buf_at
(
unified_fd
,
filename
,
buf
,
len
);
if
(
ret
<
0
)
...
...
@@ -3480,7 +3480,7 @@ int cgroup_set(const char *name, const char *lxcpath,
unified_fd
=
lxc_cmd_get_limiting_cgroup2_fd
(
name
,
lxcpath
);
if
(
unified_fd
<
0
)
return
ret_errno
(
ENO
CGROUP2
);
return
ret_errno
(
ENO
SYS
);
if
(
strnequal
(
filename
,
"devices."
,
STRLITERALLEN
(
"devices."
)))
{
struct
device_item
device
=
{};
...
...
src/lxc/lxccontainer.c
View file @
292f9985
...
...
@@ -3290,7 +3290,7 @@ static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsy
return
false
;
ret
=
cgroup_set
(
c
->
name
,
c
->
config_path
,
subsys
,
value
);
if
(
ret
==
-
ENOCGROUP2
)
{
if
(
ret
<
0
&&
ERRNO_IS_NOT_SUPPORTED
(
ret
)
)
{
cgroup_ops
=
cgroup_init
(
c
->
lxc_conf
);
if
(
!
cgroup_ops
)
return
false
;
...
...
@@ -3315,7 +3315,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys
return
-
1
;
ret
=
cgroup_get
(
c
->
name
,
c
->
config_path
,
subsys
,
retv
,
inlen
);
if
(
ret
==
-
ENOCGROUP2
)
{
if
(
ret
<
0
&&
ERRNO_IS_NOT_SUPPORTED
(
ret
)
)
{
cgroup_ops
=
cgroup_init
(
c
->
lxc_conf
);
if
(
!
cgroup_ops
)
return
-
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