render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From 06e0a9d40c52736919f32578f926bf4d829e77ec Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <06e0a9d40c52736919f32578f926bf4d829e77ec@dist-git>
a41c76
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
a41c76
Date: Mon, 27 Jul 2020 12:36:49 +0200
a41c76
Subject: [PATCH] src: assume sys/sysmacros.h always exists on Linux
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
All our supported Linux distros now have this header.
a41c76
It has never existed on FreeBSD / macOS / Mingw.
a41c76
a41c76
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
a41c76
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
a41c76
(cherry picked from commit 03c532cf9711dd6ad35380455a77141ef7d492ab)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1860421
a41c76
a41c76
Conflicts:
a41c76
- src/util/virutil.c - context, because
a41c76
  db72866310d1e520efa8ed2d4589bdb5e76a1c95 (util: add API for
a41c76
  reading password from the console) isn't backported.
a41c76
a41c76
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
a41c76
Message-Id: <ec98419d1aaa478bd3ac7a41aa9cb8b316695ef9.1595846084.git.mprivozn@redhat.com>
a41c76
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
---
a41c76
 src/conf/domain_audit.c  | 4 +---
a41c76
 src/lxc/lxc_controller.c | 4 +---
a41c76
 src/lxc/lxc_driver.c     | 4 +---
a41c76
 src/qemu/qemu_domain.c   | 4 +---
a41c76
 src/util/vircgroup.c     | 8 +-------
a41c76
 src/util/virdevmapper.c  | 4 +---
a41c76
 src/util/virutil.c       | 4 +---
a41c76
 tests/vircgroupmock.c    | 8 +-------
a41c76
 8 files changed, 8 insertions(+), 32 deletions(-)
a41c76
a41c76
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
a41c76
index fdccc585fb..6d3579e0f6 100644
a41c76
--- a/src/conf/domain_audit.c
a41c76
+++ b/src/conf/domain_audit.c
a41c76
@@ -23,9 +23,7 @@
a41c76
 
a41c76
 #include <sys/stat.h>
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 
a41c76
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
a41c76
index 42c631ed0b..0da89dba89 100644
a41c76
--- a/src/lxc/lxc_controller.c
a41c76
+++ b/src/lxc/lxc_controller.c
a41c76
@@ -25,9 +25,7 @@
a41c76
 #include <sys/wait.h>
a41c76
 #include <sys/socket.h>
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 
a41c76
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
a41c76
index 780c6ed4a2..a8c93dd228 100644
a41c76
--- a/src/lxc/lxc_driver.c
a41c76
+++ b/src/lxc/lxc_driver.c
a41c76
@@ -25,9 +25,7 @@
a41c76
 #include <sched.h>
a41c76
 #include <sys/utsname.h>
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 
a41c76
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
a41c76
index 1e968368ae..ffe88ff027 100644
a41c76
--- a/src/qemu/qemu_domain.c
a41c76
+++ b/src/qemu/qemu_domain.c
a41c76
@@ -64,9 +64,7 @@
a41c76
 #include "backup_conf.h"
a41c76
 #include "virdevmapper.h"
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 #include <sys/time.h>
a41c76
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
a41c76
index dff2f6fd3a..a45c2e7f2f 100644
a41c76
--- a/src/util/vircgroup.c
a41c76
+++ b/src/util/vircgroup.c
a41c76
@@ -25,13 +25,7 @@
a41c76
 # include <sys/mount.h>
a41c76
 # include <fcntl.h>
a41c76
 # include <sys/stat.h>
a41c76
-
a41c76
-# ifdef MAJOR_IN_MKDEV
a41c76
-#  include <sys/mkdev.h>
a41c76
-# elif MAJOR_IN_SYSMACROS
a41c76
-#  include <sys/sysmacros.h>
a41c76
-# endif
a41c76
-
a41c76
+# include <sys/sysmacros.h>
a41c76
 # include <sys/types.h>
a41c76
 # include <signal.h>
a41c76
 # include <dirent.h>
a41c76
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
a41c76
index c346432d86..40a82285f9 100644
a41c76
--- a/src/util/virdevmapper.c
a41c76
+++ b/src/util/virdevmapper.c
a41c76
@@ -20,9 +20,7 @@
a41c76
 
a41c76
 #include <config.h>
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 
a41c76
diff --git a/src/util/virutil.c b/src/util/virutil.c
a41c76
index 17fd06dbb2..5e6bbb37c0 100644
a41c76
--- a/src/util/virutil.c
a41c76
+++ b/src/util/virutil.c
a41c76
@@ -28,9 +28,7 @@
a41c76
 #include <poll.h>
a41c76
 #include <sys/stat.h>
a41c76
 
a41c76
-#ifdef MAJOR_IN_MKDEV
a41c76
-# include <sys/mkdev.h>
a41c76
-#elif MAJOR_IN_SYSMACROS
a41c76
+#ifdef __linux__
a41c76
 # include <sys/sysmacros.h>
a41c76
 #endif
a41c76
 
a41c76
diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
a41c76
index 9ec3b576d2..66b8c01852 100644
a41c76
--- a/tests/vircgroupmock.c
a41c76
+++ b/tests/vircgroupmock.c
a41c76
@@ -23,13 +23,7 @@
a41c76
 # include <unistd.h>
a41c76
 # include <fcntl.h>
a41c76
 # include <sys/stat.h>
a41c76
-
a41c76
-# ifdef MAJOR_IN_MKDEV
a41c76
-#  include <sys/mkdev.h>
a41c76
-# elif MAJOR_IN_SYSMACROS
a41c76
-#  include <sys/sysmacros.h>
a41c76
-# endif
a41c76
-
a41c76
+# include <sys/sysmacros.h>
a41c76
 # include <stdarg.h>
a41c76
 # include "testutilslxc.h"
a41c76
 # include "virstring.h"
a41c76
-- 
a41c76
2.28.0
a41c76