Merge pull request #21583 from bluca/bpf_assert

cgroup: don't emit BPF firewall warning when manager is in test mode
This commit is contained in:
Yu Watanabe
2021-12-02 07:47:17 +09:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -914,7 +914,10 @@ int bpf_firewall_supported(void) {
void emit_bpf_firewall_warning(Unit *u) {
static bool warned = false;
if (!warned) {
assert(u);
assert(u->manager);
if (!warned && !MANAGER_IS_TEST_RUN(u->manager)) {
bool quiet = bpf_firewall_unsupported_reason == -EPERM && detect_container() > 0;
log_unit_full_errno(u, quiet ? LOG_DEBUG : LOG_WARNING, bpf_firewall_unsupported_reason,
+1
View File
@@ -4,6 +4,7 @@
set -eux
systemd-analyze log-level debug
export SYSTEMD_LOG_LEVEL=debug
mkdir -p /tmp/img/usr/lib/systemd/system/
mkdir -p /tmp/img/opt/