[PATCH v2 08/53] [ACKED] vircgroup: introduce virCgroupV2ValidatePlacement

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

 



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

diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
index 800fc083f2..307a0b5142 100644
--- a/src/util/vircgroupv2.c
+++ b/src/util/vircgroupv2.c
@@ -214,6 +214,20 @@ virCgroupV2DetectPlacement(virCgroupPtr group,
 }
 
 
+static int
+virCgroupV2ValidatePlacement(virCgroupPtr group,
+                             pid_t pid ATTRIBUTE_UNUSED)
+{
+    if (!group->unified.placement) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("Could not find placement for v2 controller"));
+        return -1;
+    }
+
+    return 0;
+}
+
+
 virCgroupBackend virCgroupV2Backend = {
     .type = VIR_CGROUP_BACKEND_TYPE_V2,
 
@@ -223,6 +237,7 @@ virCgroupBackend virCgroupV2Backend = {
     .copyPlacement = virCgroupV2CopyPlacement,
     .detectMounts = virCgroupV2DetectMounts,
     .detectPlacement = virCgroupV2DetectPlacement,
+    .validatePlacement = virCgroupV2ValidatePlacement,
 };
 
 
-- 
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