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
60a22a65
Unverified
Commit
60a22a65
authored
Dec 04, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups/devices: do not log error when bpf device feature is not available
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
29b785e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
cgroup2_devices.c
src/lxc/cgroups/cgroup2_devices.c
+5
-8
No files found.
src/lxc/cgroups/cgroup2_devices.c
View file @
60a22a65
...
@@ -511,23 +511,20 @@ bool bpf_devices_cgroup_supported(void)
...
@@ -511,23 +511,20 @@ bool bpf_devices_cgroup_supported(void)
int
ret
;
int
ret
;
if
(
geteuid
()
!=
0
)
if
(
geteuid
()
!=
0
)
return
log_
error_errno
(
false
,
return
log_
trace
(
false
,
EINVAL
,
"The bpf device cgroup requires real root"
);
"The bpf device cgroup requires real root"
);
prog
=
bpf_program_new
(
BPF_PROG_TYPE_CGROUP_DEVICE
);
prog
=
bpf_program_new
(
BPF_PROG_TYPE_CGROUP_DEVICE
);
if
(
prog
<
0
)
if
(
prog
<
0
)
return
log_error_errno
(
false
,
return
log_trace
(
false
,
"Failed to allocate new bpf device cgroup program"
);
errno
,
"Failed to allocate new bpf device cgroup program"
);
ret
=
bpf_program_add_instructions
(
prog
,
dummy
,
ARRAY_SIZE
(
dummy
));
ret
=
bpf_program_add_instructions
(
prog
,
dummy
,
ARRAY_SIZE
(
dummy
));
if
(
ret
<
0
)
if
(
ret
<
0
)
return
log_error_errno
(
false
,
return
log_trace
(
false
,
"Failed to add new instructions to bpf device cgroup program"
);
errno
,
"Failed to add new instructions to bpf device cgroup program"
);
ret
=
bpf_program_load_kernel
(
prog
,
NULL
,
0
);
ret
=
bpf_program_load_kernel
(
prog
,
NULL
,
0
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
log_error_errno
(
false
,
return
log_trace
(
false
,
"Failed to load new bpf device cgroup program"
);
errno
,
"Failed to load new bpf device cgroup program"
);
return
log_trace
(
true
,
"The bpf device cgroup is supported"
);
return
log_trace
(
true
,
"The bpf device cgroup is supported"
);
}
}
...
...
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