Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- src/util/vircgroupv2.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index c4e315c91a..e17ceccac8 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -315,6 +315,14 @@ virCgroupV2HasController(virCgroupPtr group, } +static int +virCgroupV2GetAnyController(virCgroupPtr group) +{ + /* The least significant bit is position 1. */ + return ffs(group->unified.controllers) - 1; +} + + virCgroupBackend virCgroupV2Backend = { .type = VIR_CGROUP_BACKEND_TYPE_V2, @@ -328,6 +336,7 @@ virCgroupBackend virCgroupV2Backend = { .stealPlacement = virCgroupV2StealPlacement, .detectControllers = virCgroupV2DetectControllers, .hasController = virCgroupV2HasController, + .getAnyController = virCgroupV2GetAnyController, }; -- 2.17.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list