Blob Blame History Raw
From aeec7565df4f246c937f494c99a8d2d1ff03168d Mon Sep 17 00:00:00 2001
Message-Id: <aeec7565df4f246c937f494c99a8d2d1ff03168d@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Mon, 1 Jul 2019 17:05:49 +0200
Subject: [PATCH] vircgroup: Introduce standard set of typedefs and use them
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit cd77242504c8f3ba8d4ff7d1a7d4234f0aa5ede3)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <7e482b4826c05db78d1136bfa6091ab5d3097f47.1561993099.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/vircgroup.c     | 2 +-
 src/util/vircgroup.h     | 3 ++-
 src/util/vircgrouppriv.h | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 7602641713..5144b33d43 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -385,7 +385,7 @@ virCgroupDetectMountsFromFile(virCgroupPtr group,
             const char *typestr = virCgroupControllerTypeToString(i);
             int typelen = strlen(typestr);
             char *tmp = entry.mnt_opts;
-            struct _virCgroupController *controller = &group->controllers[i];
+            virCgroupControllerPtr controller = &group->controllers[i];
             while (tmp) {
                 char *next = strchr(tmp, ',');
                 int len;
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index cfa69b67cb..af93316197 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -29,7 +29,8 @@
 # include "virbitmap.h"
 
 struct _virCgroup;
-typedef struct _virCgroup *virCgroupPtr;
+typedef struct _virCgroup virCgroup;
+typedef virCgroup *virCgroupPtr;
 
 enum {
     VIR_CGROUP_CONTROLLER_CPU,
diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h
index 71788639d6..1b47d3b858 100644
--- a/src/util/vircgrouppriv.h
+++ b/src/util/vircgrouppriv.h
@@ -41,11 +41,13 @@ struct _virCgroupController {
     char *linkPoint;
     char *placement;
 };
+typedef struct _virCgroupController virCgroupController;
+typedef virCgroupController *virCgroupControllerPtr;
 
 struct _virCgroup {
     char *path;
 
-    struct _virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
+    virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
 };
 
 int virCgroupDetectMountsFromFile(virCgroupPtr group,
-- 
2.22.0