Skip to contentSkip to conversation

vfio: fix build error on CentOS 5.7

PATCH In review Leon Alrae 4 participants 4 messages Jun 17, 2015 – Jun 18, 2015

lore
Share & tools
lore

Leon Alrae

author
#0 lore raw

PATCH 1/1 vfio: fix build error on CentOS 5.7

Include linux/vfio.h after sys/ioctl.h, just like in hw/vfio/common.c.

---
CentOS 5 is one of hosts I still use. For building I already provide custom GLib to satisfy version 2.22 dependency. However, with commit 0ea2730b QEMU doesn't build on CentOS 5.7:

CC mips-softmmu/hw/vfio/platform.o
In file included from /usr/include/stdlib.h:438,

                 from /work/qemu/include/qemu-common.h:26,
                 from /work/qemu/include/hw/hw.h:5,
                 from /work/qemu/include/hw/qdev.h:4,
                 from /work/qemu/include/hw/sysbus.h:6,
                 from /work/qemu/include/hw/vfio/vfio-platform.h:19,
                 from /work/qemu/hw/vfio/platform.c:20:

/usr/include/sys/types.h:46: error: conflicting types for ‘loff_t’ /usr/include/linux/types.h:30: error: previous declaration of ‘loff_t’ was here /usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’ /usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
...

And this patch fixes above problem.

Leon

---
 hw/vfio/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/platform.c +1 -1
index 9382bb7..5c678b9 100644
@@ -14,8 +14,8 @@
  *  Copyright Red Hat, Inc. 2012
  */
 
-#include <linux/vfio.h>
 #include <sys/ioctl.h>
+#include <linux/vfio.h>
 
 #include "hw/vfio/vfio-platform.h"
 #include "qemu/error-report.h"
#1 lore raw

Hi Leon,

Quoted 16 lines · Leon Alrae

Include linux/vfio.h after sys/ioctl.h, just like in hw/vfio/common.c.

---
CentOS 5 is one of hosts I still use. For building I already provide custom GLib to satisfy version 2.22 dependency. However, with commit 0ea2730b QEMU doesn't build on CentOS 5.7:

CC mips-softmmu/hw/vfio/platform.o
In file included from /usr/include/stdlib.h:438,

                 from /work/qemu/include/qemu-common.h:26,
                 from /work/qemu/include/hw/hw.h:5,
                 from /work/qemu/include/hw/qdev.h:4,
                 from /work/qemu/include/hw/sysbus.h:6,
                 from /work/qemu/include/hw/vfio/vfio-platform.h:19,
                 from /work/qemu/hw/vfio/platform.c:20:
Quoted 7 lines

/usr/include/sys/types.h:46: error: conflicting types for ‘loff_t’ /usr/include/linux/types.h:30: error: previous declaration of ‘loff_t’ was here /usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’ /usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
...

And this patch fixes above problem.

Sorry for the inconvenience and thanks for the correction.

Best Regards

Eric

Quoted 21 lines

Leon

---
 hw/vfio/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/platform.c +1 -1
index 9382bb7..5c678b9 100644
@@ -14,8 +14,8 @@
  *  Copyright Red Hat, Inc. 2012
  */
 
-#include <linux/vfio.h>
 #include <sys/ioctl.h>
+#include <linux/vfio.h>
 
 #include "hw/vfio/vfio-platform.h"
 #include "qemu/error-report.h"
Acked-by on v1 1/1
#2 lore raw
In reply to Leon Alrae
Quoted 34 lines · Leon Alrae

Include linux/vfio.h after sys/ioctl.h, just like in hw/vfio/common.c.

---
CentOS 5 is one of hosts I still use. For building I already provide custom GLib to satisfy version 2.22 dependency. However, with commit 0ea2730b QEMU doesn't build on CentOS 5.7:

CC mips-softmmu/hw/vfio/platform.o
In file included from /usr/include/stdlib.h:438,

                 from /work/qemu/include/qemu-common.h:26,
                 from /work/qemu/include/hw/hw.h:5,
                 from /work/qemu/include/hw/qdev.h:4,
                 from /work/qemu/include/hw/sysbus.h:6,
                 from /work/qemu/include/hw/vfio/vfio-platform.h:19,
                 from /work/qemu/hw/vfio/platform.c:20:

/usr/include/sys/types.h:46: error: conflicting types for ‘loff_t’ /usr/include/linux/types.h:30: error: previous declaration of ‘loff_t’ was here /usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’ /usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
...

And this patch fixes above problem.

Leon

---
 hw/vfio/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/platform.c +0 -0
index 9382bb7..5c678b9 100644

hw/vfio/platform.c line 21

Quoted 9 lines
hw/vfio/platform.c +1 -1
@@ -14,8 +14,8 @@
  *  Copyright Red Hat, Inc. 2012
  */
 
-#include <linux/vfio.h>
 #include <sys/ioctl.h>
+#include <linux/vfio.h>
 
 #include "hw/vfio/vfio-platform.h"
 #include "qemu/error-report.h"

Thanks for the patch. Peter, if you want to pop this in as a build fix, I'd welcome it. Otherwise I can take it the normal route. Thanks.

#3 lore raw
Quoted 10 lines · Alex Williamson
Quoted 3 lines · Leon Alrae

Include linux/vfio.h after sys/ioctl.h, just like in hw/vfio/common.c.

Thanks for the patch. Peter, if you want to pop this in as a build fix, I'd welcome it. Otherwise I can take it the normal route. Thanks.

Thanks, applied to master as a build fix.

-- PMM