render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c480ed
From 2a09df456c5cceabdd6d6eee167061a74d7de9ea Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <2a09df456c5cceabdd6d6eee167061a74d7de9ea@dist-git>
c480ed
From: Pavel Hrdina <phrdina@redhat.com>
c480ed
Date: Mon, 1 Jul 2019 17:07:08 +0200
c480ed
Subject: [PATCH] vircgroup: remove VIR_CGROUP_SUPPORTED
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
tests/vircgrouptest.c uses #ifdef __linux__ for a long time and no
c480ed
failure was reported so far so it's safe to assume that __linux__ is
c480ed
good enough to guard cgroup code.
c480ed
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
(cherry picked from commit 0df626698865e5158192a9090dfe4f76c2e44fc5)
c480ed
c480ed
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
c480ed
c480ed
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
c480ed
Message-Id: <aa849f9f6c3bd44f7167a6ce08f16c4a0b7da72b.1561993100.git.phrdina@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/util/vircgroup.c | 11 +++--------
c480ed
 1 file changed, 3 insertions(+), 8 deletions(-)
c480ed
c480ed
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
c480ed
index 349c388e0a..f1ecb1dbeb 100644
c480ed
--- a/src/util/vircgroup.c
c480ed
+++ b/src/util/vircgroup.c
c480ed
@@ -70,11 +70,6 @@ VIR_LOG_INIT("util.cgroup");
c480ed
 #define CGROUP_NB_TOTAL_CPU_STAT_PARAM 3
c480ed
 #define CGROUP_NB_PER_CPU_STAT_PARAM   1
c480ed
 
c480ed
-#if defined(__linux__) && defined(HAVE_GETMNTENT_R) && \
c480ed
-    defined(_DIRENT_HAVE_D_TYPE) && defined(_SC_CLK_TCK)
c480ed
-# define VIR_CGROUP_SUPPORTED
c480ed
-#endif
c480ed
-
c480ed
 VIR_ENUM_IMPL(virCgroupController, VIR_CGROUP_CONTROLLER_LAST,
c480ed
               "cpu", "cpuacct", "cpuset", "memory", "devices",
c480ed
               "freezer", "blkio", "net_cls", "perf_event",
c480ed
@@ -119,7 +114,7 @@ virCgroupGetDevicePermsString(int perms)
c480ed
 }
c480ed
 
c480ed
 
c480ed
-#ifdef VIR_CGROUP_SUPPORTED
c480ed
+#ifdef __linux__
c480ed
 bool
c480ed
 virCgroupAvailable(void)
c480ed
 {
c480ed
@@ -2643,7 +2638,7 @@ virCgroupControllerAvailable(int controller)
c480ed
     return ret;
c480ed
 }
c480ed
 
c480ed
-#else /* !VIR_CGROUP_SUPPORTED */
c480ed
+#else /* !__linux__ */
c480ed
 
c480ed
 bool
c480ed
 virCgroupAvailable(void)
c480ed
@@ -3404,7 +3399,7 @@ virCgroupControllerAvailable(int controller ATTRIBUTE_UNUSED)
c480ed
 {
c480ed
     return false;
c480ed
 }
c480ed
-#endif /* !VIR_CGROUP_SUPPORTED */
c480ed
+#endif /* !__linux__ */
c480ed
 
c480ed
 
c480ed
 int
c480ed
-- 
c480ed
2.22.0
c480ed