diff options
Diffstat (limited to 'src/core/dbus-unit.c')
-rw-r--r-- | src/core/dbus-unit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index eef491740c..1128c42ad9 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -1314,11 +1314,15 @@ static int append_cgroup(sd_bus_message *reply, const char *p, Set *pids) { for (;;) { pid_t pid; + /* libvirt / qemu uses threaded mode and cgroup.procs cannot be read at the lower levels. + * From https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#threads, + * “cgroup.procs” in a threaded domain cgroup contains the PIDs of all processes in + * the subtree and is not readable in the subtree proper. */ r = cg_read_pid(f, &pid); + if (IN_SET(r, 0, -EOPNOTSUPP)) + break; if (r < 0) return r; - if (r == 0) - break; if (is_kernel_thread(pid) > 0) continue; |