]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vircgroup: introduce virCgroupV2ValidatePlacement
authorPavel Hrdina <phrdina@redhat.com>
Tue, 18 Sep 2018 07:17:24 +0000 (09:17 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 5 Oct 2018 13:53:29 +0000 (15:53 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/util/vircgroupv2.c

index 84c29cac5a1ca51eb592842475a8eb4b07ef80e9..c8f8e99e41e000441a7f8a199910341bc6343230 100644 (file)
@@ -205,6 +205,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,
 
@@ -214,6 +228,7 @@ virCgroupBackend virCgroupV2Backend = {
     .copyPlacement = virCgroupV2CopyPlacement,
     .detectMounts = virCgroupV2DetectMounts,
     .detectPlacement = virCgroupV2DetectPlacement,
+    .validatePlacement = virCgroupV2ValidatePlacement,
 };