render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 2a09df456c5cceabdd6d6eee167061a74d7de9ea Mon Sep 17 00:00:00 2001
Message-Id: <2a09df456c5cceabdd6d6eee167061a74d7de9ea@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Mon, 1 Jul 2019 17:07:08 +0200
Subject: [PATCH] vircgroup: remove VIR_CGROUP_SUPPORTED
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

tests/vircgrouptest.c uses #ifdef __linux__ for a long time and no
failure was reported so far so it's safe to assume that __linux__ is
good enough to guard cgroup code.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit 0df626698865e5158192a9090dfe4f76c2e44fc5)

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Message-Id: <aa849f9f6c3bd44f7167a6ce08f16c4a0b7da72b.1561993100.git.phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/vircgroup.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 349c388e0a..f1ecb1dbeb 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -70,11 +70,6 @@ VIR_LOG_INIT("util.cgroup");
 #define CGROUP_NB_TOTAL_CPU_STAT_PARAM 3
 #define CGROUP_NB_PER_CPU_STAT_PARAM   1
 
-#if defined(__linux__) && defined(HAVE_GETMNTENT_R) && \
-    defined(_DIRENT_HAVE_D_TYPE) && defined(_SC_CLK_TCK)
-# define VIR_CGROUP_SUPPORTED
-#endif
-
 VIR_ENUM_IMPL(virCgroupController, VIR_CGROUP_CONTROLLER_LAST,
               "cpu", "cpuacct", "cpuset", "memory", "devices",
               "freezer", "blkio", "net_cls", "perf_event",
@@ -119,7 +114,7 @@ virCgroupGetDevicePermsString(int perms)
 }
 
 
-#ifdef VIR_CGROUP_SUPPORTED
+#ifdef __linux__
 bool
 virCgroupAvailable(void)
 {
@@ -2643,7 +2638,7 @@ virCgroupControllerAvailable(int controller)
     return ret;
 }
 
-#else /* !VIR_CGROUP_SUPPORTED */
+#else /* !__linux__ */
 
 bool
 virCgroupAvailable(void)
@@ -3404,7 +3399,7 @@ virCgroupControllerAvailable(int controller ATTRIBUTE_UNUSED)
 {
     return false;
 }
-#endif /* !VIR_CGROUP_SUPPORTED */
+#endif /* !__linux__ */
 
 
 int
-- 
2.22.0