From: Yu Watanabe Date: Thu, 4 Sep 2025 09:49:21 +0000 (+0900) Subject: core/varlink: do not send unrealized cgroups to oomd X-Git-Tag: v258-rc4~12^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f36f3744474d701fd8f215c010782f68bf4d4624;p=thirdparty%2Fsystemd.git core/varlink: do not send unrealized cgroups to oomd Follow-ups for 23ac08115af83e3a0a937fa207fc52511aba2ffa. Since the commit, the cgroup path is set only when it is realized. Fixes the following varlink IDL validation failure: ``` systemd-oomd[1687]: Varlink-IDL: Mandatory field 'path' is null or missing on object, refusing. ``` --- diff --git a/src/core/varlink.c b/src/core/varlink.c index 8c6b95e31d1..22312a11f76 100644 --- a/src/core/varlink.c +++ b/src/core/varlink.c @@ -95,6 +95,10 @@ static int build_managed_oom_cgroups_json(Manager *m, sd_json_variant **ret) { if (!c) continue; + CGroupRuntime *crt = unit_get_cgroup_runtime(u); + if (!crt || !crt->cgroup_path) + continue; + FOREACH_ELEMENT(i, managed_oom_mode_properties) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *e = NULL;