From: Pavel Hrdina Date: Tue, 11 Dec 2018 09:35:20 +0000 (+0800) Subject: vircgroupv2: fix virCgroupV2ValidateMachineGroup X-Git-Tag: v5.0.0-rc1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=634bd528cb194439f0bea0815f579d0b0c1b1a92;p=thirdparty%2Flibvirt.git vircgroupv2: fix virCgroupV2ValidateMachineGroup When libvirt is reconnecting to running domain that uses cgroup v2 the QEMU process reports cgroup for the emulator directory because the main thread is in that cgroup. We need to remove the "/emulator" part in order to match with the root cgroup directory name for that domain. Signed-off-by: Pavel Hrdina --- diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index dc2b2a65bc..81ef578549 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -120,6 +120,13 @@ virCgroupV2ValidateMachineGroup(virCgroupPtr group, if (!(tmp = strrchr(group->unified.placement, '/'))) return false; + + if (STREQ(tmp, "/emulator")) { + *tmp = '\0'; + + if (!(tmp = strrchr(group->unified.placement, '/'))) + return false; + } tmp++; if (STRNEQ(tmp, partmachinename) &&