render / rpms / libvirt

Forked from rpms/libvirt 11 months ago
Clone
Pablo Greco 40546a
From da3574e1bcbc4779b516e8bf14f56abf2a19885d Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <da3574e1bcbc4779b516e8bf14f56abf2a19885d@dist-git>
Pablo Greco 40546a
From: Pavel Hrdina <phrdina@redhat.com>
Pablo Greco 40546a
Date: Mon, 1 Jul 2019 17:07:07 +0200
Pablo Greco 40546a
Subject: [PATCH] vircgroup: rename controllers to legacy
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
With the introduction of cgroup v2 there are new names used with
Pablo Greco 40546a
cgroups based on which version is used:
Pablo Greco 40546a
Pablo Greco 40546a
    - legacy: cgroup v1
Pablo Greco 40546a
    - unified: cgroup v2
Pablo Greco 40546a
    - hybrid: cgroup v1 and cgroup v2
Pablo Greco 40546a
Pablo Greco 40546a
Let's use 'legacy' instead of 'cgroupv1' or 'controllers' in our code.
Pablo Greco 40546a
Pablo Greco 40546a
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Pablo Greco 40546a
(cherry picked from commit 65ba48d26745450e5079f171052caa7309c99fdf)
Pablo Greco 40546a
Pablo Greco 40546a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Pablo Greco 40546a
Message-Id: <b9853bf7cd21097e0248448362f6178e31ab6279.1561993100.git.phrdina@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/util/vircgroup.c     |   6 +-
Pablo Greco 40546a
 src/util/vircgrouppriv.h |   2 +-
Pablo Greco 40546a
 src/util/vircgroupv1.c   | 140 +++++++++++++++++++--------------------
Pablo Greco 40546a
 tests/vircgrouptest.c    |  14 ++--
Pablo Greco 40546a
 4 files changed, 81 insertions(+), 81 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
Pablo Greco 40546a
index b159bda1bb..349c388e0a 100644
Pablo Greco 40546a
--- a/src/util/vircgroup.c
Pablo Greco 40546a
+++ b/src/util/vircgroup.c
Pablo Greco 40546a
@@ -1246,9 +1246,9 @@ virCgroupFree(virCgroupPtr *group)
Pablo Greco 40546a
         return;
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
-        VIR_FREE((*group)->controllers[i].mountPoint);
Pablo Greco 40546a
-        VIR_FREE((*group)->controllers[i].linkPoint);
Pablo Greco 40546a
-        VIR_FREE((*group)->controllers[i].placement);
Pablo Greco 40546a
+        VIR_FREE((*group)->legacy[i].mountPoint);
Pablo Greco 40546a
+        VIR_FREE((*group)->legacy[i].linkPoint);
Pablo Greco 40546a
+        VIR_FREE((*group)->legacy[i].placement);
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
     VIR_FREE((*group)->path);
Pablo Greco 40546a
diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h
Pablo Greco 40546a
index ee6aeedbb5..c50a25f195 100644
Pablo Greco 40546a
--- a/src/util/vircgrouppriv.h
Pablo Greco 40546a
+++ b/src/util/vircgrouppriv.h
Pablo Greco 40546a
@@ -50,7 +50,7 @@ struct _virCgroup {
Pablo Greco 40546a
 
Pablo Greco 40546a
     virCgroupBackendPtr backend;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    virCgroupV1Controller controllers[VIR_CGROUP_CONTROLLER_LAST];
Pablo Greco 40546a
+    virCgroupV1Controller legacy[VIR_CGROUP_CONTROLLER_LAST];
Pablo Greco 40546a
 };
Pablo Greco 40546a
 
Pablo Greco 40546a
 int virCgroupSetValueStr(virCgroupPtr group,
Pablo Greco 40546a
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
Pablo Greco 40546a
index 0ba8757348..482615f3c8 100644
Pablo Greco 40546a
--- a/src/util/vircgroupv1.c
Pablo Greco 40546a
+++ b/src/util/vircgroupv1.c
Pablo Greco 40546a
@@ -127,10 +127,10 @@ virCgroupV1ValidateMachineGroup(virCgroupPtr group,
Pablo Greco 40546a
         if (i == VIR_CGROUP_CONTROLLER_SYSTEMD)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (!group->controllers[i].placement)
Pablo Greco 40546a
+        if (!group->legacy[i].placement)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        tmp = strrchr(group->controllers[i].placement, '/');
Pablo Greco 40546a
+        tmp = strrchr(group->legacy[i].placement, '/');
Pablo Greco 40546a
         if (!tmp)
Pablo Greco 40546a
             return false;
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -139,7 +139,7 @@ virCgroupV1ValidateMachineGroup(virCgroupPtr group,
Pablo Greco 40546a
             i == VIR_CGROUP_CONTROLLER_CPUSET) {
Pablo Greco 40546a
             if (STREQ(tmp, "/emulator"))
Pablo Greco 40546a
                 *tmp = '\0';
Pablo Greco 40546a
-            tmp = strrchr(group->controllers[i].placement, '/');
Pablo Greco 40546a
+            tmp = strrchr(group->legacy[i].placement, '/');
Pablo Greco 40546a
             if (!tmp)
Pablo Greco 40546a
                 return false;
Pablo Greco 40546a
         }
Pablo Greco 40546a
@@ -171,15 +171,15 @@ virCgroupV1CopyMounts(virCgroupPtr group,
Pablo Greco 40546a
 {
Pablo Greco 40546a
     size_t i;
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
-        if (!parent->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!parent->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (VIR_STRDUP(group->controllers[i].mountPoint,
Pablo Greco 40546a
-                       parent->controllers[i].mountPoint) < 0)
Pablo Greco 40546a
+        if (VIR_STRDUP(group->legacy[i].mountPoint,
Pablo Greco 40546a
+                       parent->legacy[i].mountPoint) < 0)
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (VIR_STRDUP(group->controllers[i].linkPoint,
Pablo Greco 40546a
-                       parent->controllers[i].linkPoint) < 0)
Pablo Greco 40546a
+        if (VIR_STRDUP(group->legacy[i].linkPoint,
Pablo Greco 40546a
+                       parent->legacy[i].linkPoint) < 0)
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
     }
Pablo Greco 40546a
     return 0;
Pablo Greco 40546a
@@ -193,14 +193,14 @@ virCgroupV1CopyPlacement(virCgroupPtr group,
Pablo Greco 40546a
 {
Pablo Greco 40546a
     size_t i;
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (i == VIR_CGROUP_CONTROLLER_SYSTEMD)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (path[0] == '/') {
Pablo Greco 40546a
-            if (VIR_STRDUP(group->controllers[i].placement, path) < 0)
Pablo Greco 40546a
+            if (VIR_STRDUP(group->legacy[i].placement, path) < 0)
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
         } else {
Pablo Greco 40546a
             /*
Pablo Greco 40546a
@@ -208,10 +208,10 @@ virCgroupV1CopyPlacement(virCgroupPtr group,
Pablo Greco 40546a
              * parent == "/libvirt.service" + path == "" => "/libvirt.service"
Pablo Greco 40546a
              * parent == "/libvirt.service" + path == "foo" => "/libvirt.service/foo"
Pablo Greco 40546a
              */
Pablo Greco 40546a
-            if (virAsprintf(&group->controllers[i].placement,
Pablo Greco 40546a
+            if (virAsprintf(&group->legacy[i].placement,
Pablo Greco 40546a
                             "%s%s%s",
Pablo Greco 40546a
-                            parent->controllers[i].placement,
Pablo Greco 40546a
-                            (STREQ(parent->controllers[i].placement, "/") ||
Pablo Greco 40546a
+                            parent->legacy[i].placement,
Pablo Greco 40546a
+                            (STREQ(parent->legacy[i].placement, "/") ||
Pablo Greco 40546a
                              STREQ(path, "") ? "" : "/"),
Pablo Greco 40546a
                             path) < 0)
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
@@ -320,7 +320,7 @@ virCgroupV1DetectMounts(virCgroupPtr group,
Pablo Greco 40546a
              * once. We need to save the results of the last one,
Pablo Greco 40546a
              * and we need to be careful to release the memory used
Pablo Greco 40546a
              * by previous processing. */
Pablo Greco 40546a
-            virCgroupV1ControllerPtr controller = &group->controllers[i];
Pablo Greco 40546a
+            virCgroupV1ControllerPtr controller = &group->legacy[i];
Pablo Greco 40546a
 
Pablo Greco 40546a
             VIR_FREE(controller->mountPoint);
Pablo Greco 40546a
             VIR_FREE(controller->linkPoint);
Pablo Greco 40546a
@@ -350,19 +350,19 @@ virCgroupV1DetectPlacement(virCgroupPtr group,
Pablo Greco 40546a
         const char *typestr = virCgroupV1ControllerTypeToString(i);
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (virCgroupV1MountOptsMatchController(controllers, typestr) &&
Pablo Greco 40546a
-            group->controllers[i].mountPoint != NULL &&
Pablo Greco 40546a
-            group->controllers[i].placement == NULL) {
Pablo Greco 40546a
+            group->legacy[i].mountPoint != NULL &&
Pablo Greco 40546a
+            group->legacy[i].placement == NULL) {
Pablo Greco 40546a
             /*
Pablo Greco 40546a
              * selfpath == "/" + path="" -> "/"
Pablo Greco 40546a
              * selfpath == "/libvirt.service" + path == "" -> "/libvirt.service"
Pablo Greco 40546a
              * selfpath == "/libvirt.service" + path == "foo" -> "/libvirt.service/foo"
Pablo Greco 40546a
              */
Pablo Greco 40546a
             if (i == VIR_CGROUP_CONTROLLER_SYSTEMD) {
Pablo Greco 40546a
-                if (VIR_STRDUP(group->controllers[i].placement,
Pablo Greco 40546a
+                if (VIR_STRDUP(group->legacy[i].placement,
Pablo Greco 40546a
                                selfpath) < 0)
Pablo Greco 40546a
                     return -1;
Pablo Greco 40546a
             } else {
Pablo Greco 40546a
-                if (virAsprintf(&group->controllers[i].placement,
Pablo Greco 40546a
+                if (virAsprintf(&group->legacy[i].placement,
Pablo Greco 40546a
                                 "%s%s%s", selfpath,
Pablo Greco 40546a
                                 (STREQ(selfpath, "/") ||
Pablo Greco 40546a
                                  STREQ(path, "") ? "" : "/"),
Pablo Greco 40546a
@@ -383,22 +383,22 @@ virCgroupV1ValidatePlacement(virCgroupPtr group,
Pablo Greco 40546a
     size_t i;
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (!group->controllers[i].placement) {
Pablo Greco 40546a
+        if (!group->legacy[i].placement) {
Pablo Greco 40546a
             virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                            _("Could not find placement for v1 controller %s at %s"),
Pablo Greco 40546a
                            virCgroupV1ControllerTypeToString(i),
Pablo Greco 40546a
-                           group->controllers[i].placement);
Pablo Greco 40546a
+                           group->legacy[i].placement);
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
         VIR_DEBUG("Detected mount/mapping %zu:%s at %s in %s for pid %lld",
Pablo Greco 40546a
                   i,
Pablo Greco 40546a
                   virCgroupV1ControllerTypeToString(i),
Pablo Greco 40546a
-                  group->controllers[i].mountPoint,
Pablo Greco 40546a
-                  group->controllers[i].placement,
Pablo Greco 40546a
+                  group->legacy[i].mountPoint,
Pablo Greco 40546a
+                  group->legacy[i].placement,
Pablo Greco 40546a
                   (long long) pid);
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -411,7 +411,7 @@ virCgroupV1StealPlacement(virCgroupPtr group)
Pablo Greco 40546a
 {
Pablo Greco 40546a
     char *ret = NULL;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    VIR_STEAL_PTR(ret, group->controllers[VIR_CGROUP_CONTROLLER_SYSTEMD].placement);
Pablo Greco 40546a
+    VIR_STEAL_PTR(ret, group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].placement);
Pablo Greco 40546a
 
Pablo Greco 40546a
     return ret;
Pablo Greco 40546a
 }
Pablo Greco 40546a
@@ -430,7 +430,7 @@ virCgroupV1DetectControllers(virCgroupPtr group,
Pablo Greco 40546a
         for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
             if (((1 << i) & controllers)) {
Pablo Greco 40546a
                 /* Remove non-existent controllers  */
Pablo Greco 40546a
-                if (!group->controllers[i].mountPoint) {
Pablo Greco 40546a
+                if (!group->legacy[i].mountPoint) {
Pablo Greco 40546a
                     VIR_DEBUG("Requested controller '%s' not mounted, ignoring",
Pablo Greco 40546a
                               virCgroupV1ControllerTypeToString(i));
Pablo Greco 40546a
                     controllers &= ~(1 << i);
Pablo Greco 40546a
@@ -441,9 +441,9 @@ virCgroupV1DetectControllers(virCgroupPtr group,
Pablo Greco 40546a
             VIR_DEBUG("Controller '%s' wanted=%s, mount='%s'",
Pablo Greco 40546a
                       virCgroupV1ControllerTypeToString(i),
Pablo Greco 40546a
                       (1 << i) & controllers ? "yes" : "no",
Pablo Greco 40546a
-                      NULLSTR(group->controllers[i].mountPoint));
Pablo Greco 40546a
+                      NULLSTR(group->legacy[i].mountPoint));
Pablo Greco 40546a
             if (!((1 << i) & controllers) &&
Pablo Greco 40546a
-                group->controllers[i].mountPoint) {
Pablo Greco 40546a
+                group->legacy[i].mountPoint) {
Pablo Greco 40546a
                 /* Check whether a request to disable a controller
Pablo Greco 40546a
                  * clashes with co-mounting of controllers */
Pablo Greco 40546a
                 for (j = 0; j < VIR_CGROUP_CONTROLLER_LAST; j++) {
Pablo Greco 40546a
@@ -452,8 +452,8 @@ virCgroupV1DetectControllers(virCgroupPtr group,
Pablo Greco 40546a
                     if (!((1 << j) & controllers))
Pablo Greco 40546a
                         continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-                    if (STREQ_NULLABLE(group->controllers[i].mountPoint,
Pablo Greco 40546a
-                                       group->controllers[j].mountPoint)) {
Pablo Greco 40546a
+                    if (STREQ_NULLABLE(group->legacy[i].mountPoint,
Pablo Greco 40546a
+                                       group->legacy[j].mountPoint)) {
Pablo Greco 40546a
                         virReportSystemError(EINVAL,
Pablo Greco 40546a
                                              _("V1 controller '%s' is not wanted, but '%s' is co-mounted"),
Pablo Greco 40546a
                                              virCgroupV1ControllerTypeToString(i),
Pablo Greco 40546a
@@ -461,7 +461,7 @@ virCgroupV1DetectControllers(virCgroupPtr group,
Pablo Greco 40546a
                         return -1;
Pablo Greco 40546a
                     }
Pablo Greco 40546a
                 }
Pablo Greco 40546a
-                VIR_FREE(group->controllers[i].mountPoint);
Pablo Greco 40546a
+                VIR_FREE(group->legacy[i].mountPoint);
Pablo Greco 40546a
             }
Pablo Greco 40546a
         }
Pablo Greco 40546a
     } else {
Pablo Greco 40546a
@@ -470,8 +470,8 @@ virCgroupV1DetectControllers(virCgroupPtr group,
Pablo Greco 40546a
         for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
             VIR_DEBUG("Controller '%s' present=%s",
Pablo Greco 40546a
                       virCgroupV1ControllerTypeToString(i),
Pablo Greco 40546a
-                      group->controllers[i].mountPoint ? "yes" : "no");
Pablo Greco 40546a
-            if (group->controllers[i].mountPoint == NULL)
Pablo Greco 40546a
+                      group->legacy[i].mountPoint ? "yes" : "no");
Pablo Greco 40546a
+            if (group->legacy[i].mountPoint == NULL)
Pablo Greco 40546a
                 continue;
Pablo Greco 40546a
             controllers |= (1 << i);
Pablo Greco 40546a
         }
Pablo Greco 40546a
@@ -485,7 +485,7 @@ static bool
Pablo Greco 40546a
 virCgroupV1HasController(virCgroupPtr group,
Pablo Greco 40546a
                          int controller)
Pablo Greco 40546a
 {
Pablo Greco 40546a
-    return group->controllers[controller].mountPoint != NULL;
Pablo Greco 40546a
+    return group->legacy[controller].mountPoint != NULL;
Pablo Greco 40546a
 }
Pablo Greco 40546a
 
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -499,9 +499,9 @@ virCgroupV1GetAnyController(virCgroupPtr group)
Pablo Greco 40546a
          * of '/' to avoid doing bad stuff to the root
Pablo Greco 40546a
          * cgroup
Pablo Greco 40546a
          */
Pablo Greco 40546a
-        if (group->controllers[i].mountPoint &&
Pablo Greco 40546a
-            group->controllers[i].placement &&
Pablo Greco 40546a
-            STRNEQ(group->controllers[i].placement, "/")) {
Pablo Greco 40546a
+        if (group->legacy[i].mountPoint &&
Pablo Greco 40546a
+            group->legacy[i].placement &&
Pablo Greco 40546a
+            STRNEQ(group->legacy[i].placement, "/")) {
Pablo Greco 40546a
             return i;
Pablo Greco 40546a
         }
Pablo Greco 40546a
     }
Pablo Greco 40546a
@@ -516,14 +516,14 @@ virCgroupV1PathOfController(virCgroupPtr group,
Pablo Greco 40546a
                             const char *key,
Pablo Greco 40546a
                             char **path)
Pablo Greco 40546a
 {
Pablo Greco 40546a
-    if (group->controllers[controller].mountPoint == NULL) {
Pablo Greco 40546a
+    if (group->legacy[controller].mountPoint == NULL) {
Pablo Greco 40546a
         virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                        _("v1 controller '%s' is not mounted"),
Pablo Greco 40546a
                        virCgroupV1ControllerTypeToString(controller));
Pablo Greco 40546a
         return -1;
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
-    if (group->controllers[controller].placement == NULL) {
Pablo Greco 40546a
+    if (group->legacy[controller].placement == NULL) {
Pablo Greco 40546a
         virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                        _("v1 controller '%s' is not enabled for group"),
Pablo Greco 40546a
                        virCgroupV1ControllerTypeToString(controller));
Pablo Greco 40546a
@@ -531,8 +531,8 @@ virCgroupV1PathOfController(virCgroupPtr group,
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
     if (virAsprintf(path, "%s%s/%s",
Pablo Greco 40546a
-                    group->controllers[controller].mountPoint,
Pablo Greco 40546a
-                    group->controllers[controller].placement,
Pablo Greco 40546a
+                    group->legacy[controller].mountPoint,
Pablo Greco 40546a
+                    group->legacy[controller].placement,
Pablo Greco 40546a
                     key ? key : "") < 0)
Pablo Greco 40546a
         return -1;
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -618,7 +618,7 @@ virCgroupV1MakeGroup(virCgroupPtr parent,
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* Skip over controllers that aren't mounted */
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint) {
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint) {
Pablo Greco 40546a
             VIR_DEBUG("Skipping unmounted controller %s",
Pablo Greco 40546a
                       virCgroupV1ControllerTypeToString(i));
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
@@ -639,7 +639,7 @@ virCgroupV1MakeGroup(virCgroupPtr parent,
Pablo Greco 40546a
                  * treat blkio as unmounted if mkdir fails. */
Pablo Greco 40546a
                 if (i == VIR_CGROUP_CONTROLLER_BLKIO) {
Pablo Greco 40546a
                     VIR_DEBUG("Ignoring mkdir failure with blkio controller. Kernel probably too old");
Pablo Greco 40546a
-                    VIR_FREE(group->controllers[i].mountPoint);
Pablo Greco 40546a
+                    VIR_FREE(group->legacy[i].mountPoint);
Pablo Greco 40546a
                     continue;
Pablo Greco 40546a
                 } else {
Pablo Greco 40546a
                     virReportSystemError(errno,
Pablo Greco 40546a
@@ -649,7 +649,7 @@ virCgroupV1MakeGroup(virCgroupPtr parent,
Pablo Greco 40546a
                 }
Pablo Greco 40546a
             }
Pablo Greco 40546a
             if (i == VIR_CGROUP_CONTROLLER_CPUSET &&
Pablo Greco 40546a
-                group->controllers[i].mountPoint != NULL &&
Pablo Greco 40546a
+                group->legacy[i].mountPoint != NULL &&
Pablo Greco 40546a
                 virCgroupV1CpuSetInherit(parent, group) < 0) {
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
             }
Pablo Greco 40546a
@@ -659,7 +659,7 @@ virCgroupV1MakeGroup(virCgroupPtr parent,
Pablo Greco 40546a
              */
Pablo Greco 40546a
             if ((flags & VIR_CGROUP_MEM_HIERACHY) &&
Pablo Greco 40546a
                 i == VIR_CGROUP_CONTROLLER_MEMORY &&
Pablo Greco 40546a
-                group->controllers[i].mountPoint != NULL &&
Pablo Greco 40546a
+                group->legacy[i].mountPoint != NULL &&
Pablo Greco 40546a
                 virCgroupV1SetMemoryUseHierarchy(group) < 0) {
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
             }
Pablo Greco 40546a
@@ -682,7 +682,7 @@ virCgroupV1Remove(virCgroupPtr group)
Pablo Greco 40546a
         VIR_AUTOFREE(char *) grppath = NULL;
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* Skip over controllers not mounted */
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* We must never rmdir() in systemd's hierarchy */
Pablo Greco 40546a
@@ -691,7 +691,7 @@ virCgroupV1Remove(virCgroupPtr group)
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* Don't delete the root group, if we accidentally
Pablo Greco 40546a
            ended up in it for some reason */
Pablo Greco 40546a
-        if (STREQ(group->controllers[i].placement, "/"))
Pablo Greco 40546a
+        if (STREQ(group->legacy[i].placement, "/"))
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (virCgroupV1PathOfController(group,
Pablo Greco 40546a
@@ -719,7 +719,7 @@ virCgroupV1AddTask(virCgroupPtr group,
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
         /* Skip over controllers not mounted */
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* We must never add tasks in systemd's hierarchy
Pablo Greco 40546a
@@ -766,17 +766,17 @@ virCgroupV1IdentifyRoot(virCgroupPtr group)
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
         char *tmp;
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
-        if (!(tmp = strrchr(group->controllers[i].mountPoint, '/'))) {
Pablo Greco 40546a
+        if (!(tmp = strrchr(group->legacy[i].mountPoint, '/'))) {
Pablo Greco 40546a
             virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                            _("Could not find directory separator in %s"),
Pablo Greco 40546a
-                           group->controllers[i].mountPoint);
Pablo Greco 40546a
+                           group->legacy[i].mountPoint);
Pablo Greco 40546a
             return NULL;
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (VIR_STRNDUP(ret, group->controllers[i].mountPoint,
Pablo Greco 40546a
-                        tmp - group->controllers[i].mountPoint) < 0)
Pablo Greco 40546a
+        if (VIR_STRNDUP(ret, group->legacy[i].mountPoint,
Pablo Greco 40546a
+                        tmp - group->legacy[i].mountPoint) < 0)
Pablo Greco 40546a
             return NULL;
Pablo Greco 40546a
         return ret;
Pablo Greco 40546a
     }
Pablo Greco 40546a
@@ -820,44 +820,44 @@ virCgroupV1BindMount(virCgroupPtr group,
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
-        if (!group->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!group->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (!virFileExists(group->controllers[i].mountPoint)) {
Pablo Greco 40546a
+        if (!virFileExists(group->legacy[i].mountPoint)) {
Pablo Greco 40546a
             VIR_AUTOFREE(char *) src = NULL;
Pablo Greco 40546a
             if (virAsprintf(&src, "%s%s",
Pablo Greco 40546a
                             oldroot,
Pablo Greco 40546a
-                            group->controllers[i].mountPoint) < 0)
Pablo Greco 40546a
+                            group->legacy[i].mountPoint) < 0)
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
 
Pablo Greco 40546a
             VIR_DEBUG("Create mount point '%s'",
Pablo Greco 40546a
-                      group->controllers[i].mountPoint);
Pablo Greco 40546a
-            if (virFileMakePath(group->controllers[i].mountPoint) < 0) {
Pablo Greco 40546a
+                      group->legacy[i].mountPoint);
Pablo Greco 40546a
+            if (virFileMakePath(group->legacy[i].mountPoint) < 0) {
Pablo Greco 40546a
                 virReportSystemError(errno,
Pablo Greco 40546a
                                      _("Unable to create directory %s"),
Pablo Greco 40546a
-                                     group->controllers[i].mountPoint);
Pablo Greco 40546a
+                                     group->legacy[i].mountPoint);
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
             }
Pablo Greco 40546a
 
Pablo Greco 40546a
-            if (mount(src, group->controllers[i].mountPoint, "none", MS_BIND,
Pablo Greco 40546a
+            if (mount(src, group->legacy[i].mountPoint, "none", MS_BIND,
Pablo Greco 40546a
                       NULL) < 0) {
Pablo Greco 40546a
                 virReportSystemError(errno,
Pablo Greco 40546a
                                      _("Failed to bind cgroup '%s' on '%s'"),
Pablo Greco 40546a
-                                     src, group->controllers[i].mountPoint);
Pablo Greco 40546a
+                                     src, group->legacy[i].mountPoint);
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
             }
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (group->controllers[i].linkPoint) {
Pablo Greco 40546a
+        if (group->legacy[i].linkPoint) {
Pablo Greco 40546a
             VIR_DEBUG("Link mount point '%s' to '%s'",
Pablo Greco 40546a
-                      group->controllers[i].mountPoint,
Pablo Greco 40546a
-                      group->controllers[i].linkPoint);
Pablo Greco 40546a
-            if (symlink(group->controllers[i].mountPoint,
Pablo Greco 40546a
-                        group->controllers[i].linkPoint) < 0) {
Pablo Greco 40546a
+                      group->legacy[i].mountPoint,
Pablo Greco 40546a
+                      group->legacy[i].linkPoint);
Pablo Greco 40546a
+            if (symlink(group->legacy[i].mountPoint,
Pablo Greco 40546a
+                        group->legacy[i].linkPoint) < 0) {
Pablo Greco 40546a
                 virReportSystemError(errno,
Pablo Greco 40546a
                                      _("Unable to symlink directory %s to %s"),
Pablo Greco 40546a
-                                     group->controllers[i].mountPoint,
Pablo Greco 40546a
-                                     group->controllers[i].linkPoint);
Pablo Greco 40546a
+                                     group->legacy[i].mountPoint,
Pablo Greco 40546a
+                                     group->legacy[i].linkPoint);
Pablo Greco 40546a
                 return -1;
Pablo Greco 40546a
             }
Pablo Greco 40546a
         }
Pablo Greco 40546a
@@ -885,11 +885,11 @@ virCgroupV1SetOwner(virCgroupPtr cgroup,
Pablo Greco 40546a
         if (!((1 << i) & controllers))
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (!cgroup->controllers[i].mountPoint)
Pablo Greco 40546a
+        if (!cgroup->legacy[i].mountPoint)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
-        if (virAsprintf(&base, "%s%s", cgroup->controllers[i].mountPoint,
Pablo Greco 40546a
-                        cgroup->controllers[i].placement) < 0)
Pablo Greco 40546a
+        if (virAsprintf(&base, "%s%s", cgroup->legacy[i].mountPoint,
Pablo Greco 40546a
+                        cgroup->legacy[i].placement) < 0)
Pablo Greco 40546a
             goto cleanup;
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (virDirOpen(&dh, base) < 0)
Pablo Greco 40546a
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
Pablo Greco 40546a
index 588a6e824d..c4bf987ca1 100644
Pablo Greco 40546a
--- a/tests/vircgrouptest.c
Pablo Greco 40546a
+++ b/tests/vircgrouptest.c
Pablo Greco 40546a
@@ -56,25 +56,25 @@ static int validateCgroup(virCgroupPtr cgroup,
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
         if (STRNEQ_NULLABLE(expectMountPoint[i],
Pablo Greco 40546a
-                            cgroup->controllers[i].mountPoint)) {
Pablo Greco 40546a
+                            cgroup->legacy[i].mountPoint)) {
Pablo Greco 40546a
             fprintf(stderr, "Wrong mount '%s', expected '%s' for '%s'\n",
Pablo Greco 40546a
-                    cgroup->controllers[i].mountPoint,
Pablo Greco 40546a
+                    cgroup->legacy[i].mountPoint,
Pablo Greco 40546a
                     expectMountPoint[i],
Pablo Greco 40546a
                     virCgroupControllerTypeToString(i));
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
         }
Pablo Greco 40546a
         if (STRNEQ_NULLABLE(expectLinkPoint[i],
Pablo Greco 40546a
-                            cgroup->controllers[i].linkPoint)) {
Pablo Greco 40546a
+                            cgroup->legacy[i].linkPoint)) {
Pablo Greco 40546a
             fprintf(stderr, "Wrong link '%s', expected '%s' for '%s'\n",
Pablo Greco 40546a
-                    cgroup->controllers[i].linkPoint,
Pablo Greco 40546a
+                    cgroup->legacy[i].linkPoint,
Pablo Greco 40546a
                     expectLinkPoint[i],
Pablo Greco 40546a
                     virCgroupControllerTypeToString(i));
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
         }
Pablo Greco 40546a
         if (STRNEQ_NULLABLE(expectPlacement[i],
Pablo Greco 40546a
-                            cgroup->controllers[i].placement)) {
Pablo Greco 40546a
+                            cgroup->legacy[i].placement)) {
Pablo Greco 40546a
             fprintf(stderr, "Wrong placement '%s', expected '%s' for '%s'\n",
Pablo Greco 40546a
-                    cgroup->controllers[i].placement,
Pablo Greco 40546a
+                    cgroup->legacy[i].placement,
Pablo Greco 40546a
                     expectPlacement[i],
Pablo Greco 40546a
                     virCgroupControllerTypeToString(i));
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
@@ -174,7 +174,7 @@ testCgroupDetectMounts(const void *args)
Pablo Greco 40546a
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
Pablo Greco 40546a
         virBufferAsprintf(&buf, "%-12s %s\n",
Pablo Greco 40546a
                           virCgroupControllerTypeToString(i),
Pablo Greco 40546a
-                          NULLSTR(group->controllers[i].mountPoint));
Pablo Greco 40546a
+                          NULLSTR(group->legacy[i].mountPoint));
Pablo Greco 40546a
     }
Pablo Greco 40546a
     if (virBufferCheckError(&buf) < 0)
Pablo Greco 40546a
         goto cleanup;
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a