Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/vircgroupv2.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
index 77f3c3e978..c4e315c91a 100644
--- a/src/util/vircgroupv2.c
+++ b/src/util/vircgroupv2.c
@@ -307,6 +307,14 @@ virCgroupV2DetectControllers(virCgroupPtr group,
}
+static bool
+virCgroupV2HasController(virCgroupPtr group,
+ int controller)
+{
+ return group->unified.controllers & (1 << controller);
+}
+
+
virCgroupBackend virCgroupV2Backend = {
.type = VIR_CGROUP_BACKEND_TYPE_V2,
@@ -319,6 +327,7 @@ virCgroupBackend virCgroupV2Backend = {
.validatePlacement = virCgroupV2ValidatePlacement,
.stealPlacement = virCgroupV2StealPlacement,
.detectControllers = virCgroupV2DetectControllers,
+ .hasController = virCgroupV2HasController,
};
--
2.17.1