File xen.796dea37fb229c34740f98bf80f3263d7a4e3c6d.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Wed, 15 Mar 2017 07:01:34 +0000
Subject: 796dea37fb229c34740f98bf80f3263d7a4e3c6d
tools: include sys/sysmacros.h on Linux
Due to a bug in the glibc headers the macros makedev(), major() and
minor() where avaialble by including sys/types.h. This bug was
addressed in glibc-2.25 by introducing a warning when these macros are
used. Since Xen is build with -Werror this new warning cause a compile
error.
Use sys/sysmacros.h to define these three macros.
blktap2 is already Linux specific. The kernel header which was used to
get makedev() does not provided it anymore, and it was wrong to use a
kernel header anyway.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
tools/blktap2/control/tap-ctl-allocate.c | 1 +
tools/libxl/libxl_osdeps.h | 1 +
2 files changed, 2 insertions(+)
--- a/tools/blktap2/control/tap-ctl-allocate.c
+++ b/tools/blktap2/control/tap-ctl-allocate.c
@@ -24,24 +24,25 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#include <libgen.h>
+#include <sys/sysmacros.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/major.h>
#include "tap-ctl.h"
#include "blktap2.h"
static int
tap_ctl_prepare_directory(const char *dir)
{
int err;
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -30,24 +30,25 @@
#define SYSFS_PCIBACK_DRIVER "/kern/xen/pci"
#define NETBACK_NIC_NAME "xvif%ui%d"
#include <util.h>
#include <uuid.h>
#elif defined(__OpenBSD__)
#include <util.h>
#elif defined(__linux__)
#define SYSFS_USB_DEV "/sys/bus/usb/devices"
#define SYSFS_USBBACK_DRIVER "/sys/bus/usb/drivers/usbback"
#define SYSFS_PCI_DEV "/sys/bus/pci/devices"
#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback"
#define NETBACK_NIC_NAME "vif%u.%d"
+#include <sys/sysmacros.h>
#include <pty.h>
#include <uuid/uuid.h>
#elif defined(__sun__)
#include <stropts.h>
#elif defined(__FreeBSD__)
#define SYSFS_USB_DEV "/dev/null"
#define SYSFS_USBBACK_DRIVER "/dev/null"
#define SYSFS_PCI_DEV "/dev/null"
#define SYSFS_PCIBACK_DRIVER "/dev/null"
#define NETBACK_NIC_NAME "xnb%u.%d"
#include <libutil.h>
#include <sys/endian.h>