Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/vircgroupv2.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
index 26fdb46098..45af617971 100644
--- a/src/util/vircgroupv2.c
+++ b/src/util/vircgroupv2.c
@@ -1449,6 +1449,21 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group,
}
+static bool
+virCgroupV2SupportsCpuBW(virCgroupPtr cgroup)
+{
+ VIR_AUTOFREE(char *) path = NULL;
+
+ if (virCgroupV2PathOfController(cgroup, VIR_CGROUP_CONTROLLER_CPU,
+ "cpu.max", &path) < 0) {
+ virResetLastError();
+ return false;
+ }
+
+ return virFileExists(path);
+}
+
+
virCgroupBackend virCgroupV2Backend = {
.type = VIR_CGROUP_BACKEND_TYPE_V2,
@@ -1503,6 +1518,7 @@ virCgroupBackend virCgroupV2Backend = {
.getCpuCfsPeriod = virCgroupV2GetCpuCfsPeriod,
.setCpuCfsQuota = virCgroupV2SetCpuCfsQuota,
.getCpuCfsQuota = virCgroupV2GetCpuCfsQuota,
+ .supportsCpuBW = virCgroupV2SupportsCpuBW,
};
--
2.17.1