mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
vircgroupv2: properly detect empty tasks
With cgroups v2 the file cgroup.procs will never be empty if threading is enabled as it will always have ID of all processes even if all threads of the processes are moved to sub-cgroups. If that happens the file cgroup.threads will be empty. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
09c12ba248
commit
e85cfb095a
@ -521,7 +521,7 @@ virCgroupV2HasEmptyTasks(virCgroupPtr cgroup,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
g_autofree char *content = NULL;
|
g_autofree char *content = NULL;
|
||||||
|
|
||||||
ret = virCgroupGetValueStr(cgroup, controller, "cgroup.procs", &content);
|
ret = virCgroupGetValueStr(cgroup, controller, "cgroup.threads", &content);
|
||||||
|
|
||||||
if (ret == 0 && content[0] == '\0')
|
if (ret == 0 && content[0] == '\0')
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user