[PATCH 39/53] vircgroup: introduce virCgroupV2SupportsCpuBW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/util/vircgroupv2.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
index d52e065685..61c881f7e2 100644
--- a/src/util/vircgroupv2.c
+++ b/src/util/vircgroupv2.c
@@ -1443,6 +1443,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,
 
@@ -1497,6 +1512,7 @@ virCgroupBackend virCgroupV2Backend = {
     .getCpuCfsPeriod = virCgroupV2GetCpuCfsPeriod,
     .setCpuCfsQuota = virCgroupV2SetCpuCfsQuota,
     .getCpuCfsQuota = virCgroupV2GetCpuCfsQuota,
+    .supportsCpuBW = virCgroupV2SupportsCpuBW,
 };
 
 
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux