From: Christian Brauner Date: Tue, 3 Dec 2019 23:55:42 +0000 (+0100) Subject: cgroups/devices: do not log error when bpf device feature is not available X-Git-Tag: lxc-4.0.0~84^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6900ebfa2d983c924116c74d9012e0439c2f155c;p=thirdparty%2Flxc.git cgroups/devices: do not log error when bpf device feature is not available Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgroup2_devices.c b/src/lxc/cgroups/cgroup2_devices.c index e72cffc1c..cb6f76abc 100644 --- a/src/lxc/cgroups/cgroup2_devices.c +++ b/src/lxc/cgroups/cgroup2_devices.c @@ -511,23 +511,20 @@ bool bpf_devices_cgroup_supported(void) int ret; if (geteuid() != 0) - return log_error_errno(false, - EINVAL, "The bpf device cgroup requires real root"); + return log_trace(false, + "The bpf device cgroup requires real root"); prog = bpf_program_new(BPF_PROG_TYPE_CGROUP_DEVICE); if (prog < 0) - return log_error_errno(false, - errno, "Failed to allocate new bpf device cgroup program"); + return log_trace(false, "Failed to allocate new bpf device cgroup program"); ret = bpf_program_add_instructions(prog, dummy, ARRAY_SIZE(dummy)); if (ret < 0) - return log_error_errno(false, - errno, "Failed to add new instructions to bpf device cgroup program"); + return log_trace(false, "Failed to add new instructions to bpf device cgroup program"); ret = bpf_program_load_kernel(prog, NULL, 0); if (ret < 0) - return log_error_errno(false, - errno, "Failed to load new bpf device cgroup program"); + return log_trace(false, "Failed to load new bpf device cgroup program"); return log_trace(true, "The bpf device cgroup is supported"); }