Skip to contentSkip to conversation

qemu-xen-trad: fix sys-queue.h usage on BSD systems

PATCH In review Roger Pau Monne 3 participants 3 messages Jun 1, 2012 – Jun 7, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-xen-trad: fix sys-queue.h usage on BSD systems

BSD systems already have a sys/queue.h file, which has more macros than the one Qemu uses, and some header files depend on having that macros defined (sys/disk.h for example). Disable sys-queue.h on BSD systems and include the native one.

This is not a backport because the original patch is too dificult to backport, it's commit 72cf2d4f0e181d0d3a3122e04129c58a95da713e.

Doing a diff -bB shows that the Qemu version is just a stripped version of the original NetBSD header, with many macros removed, but no new ones added.

Cc Stefano Stabellini <[email protected]>
---
 sys-queue.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sys-queue.h +6 -0
index cb6a4c8..55c26fe 100644
@@ -36,6 +36,12 @@
  *      @(#)queue.h     8.5 (Berkeley) 8/20/94
  */
 
+#include "config-host.h"
+#ifdef _BSD
+/* include native header before sys-queue.h */
+#include <sys/queue.h>
+#endif
+
 #ifndef _SYS_QUEUE_H_
 #define _SYS_QUEUE_H_
 
Signature · 1 line
1.7.7.5 (Apple Git-26)
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Roger Pau Monne

BSD systems already have a sys/queue.h file, which has more macros than the one Qemu uses, and some header files depend on having that macros defined (sys/disk.h for example). Disable sys-queue.h on BSD systems and include the native one.

This is not a backport because the original patch is too dificult to backport, it's commit 72cf2d4f0e181d0d3a3122e04129c58a95da713e.

Quoted 6 lines

Doing a diff -bB shows that the Qemu version is just a stripped version of the original NetBSD header, with many macros removed, but no new ones added.

Cc Stefano Stabellini <[email protected]>
Quoted 23 lines
 sys-queue.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
sys-queue.h +6 -0
index cb6a4c8..55c26fe 100644
@@ -36,6 +36,12 @@
  *      @(#)queue.h     8.5 (Berkeley) 8/20/94
  */
 
+#include "config-host.h"
+#ifdef _BSD
+/* include native header before sys-queue.h */
+#include <sys/queue.h>
+#endif
+
 #ifndef _SYS_QUEUE_H_
 #define _SYS_QUEUE_H_
 
Signature · 1 line
1.7.7.5 (Apple Git-26)
#2 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] qemu-xen-trad: fix sys-queue.h usage on BSD systems"):

Quoted 9 lines · Roger Pau Monne
Quoted 8 lines

BSD systems already have a sys/queue.h file, which has more macros than the one Qemu uses, and some header files depend on having that macros defined (sys/disk.h for example). Disable sys-queue.h on BSD systems and include the native one.

This is not a backport because the original patch is too dificult to backport, it's commit 72cf2d4f0e181d0d3a3122e04129c58a95da713e.

Quoted 8 lines
Quoted 6 lines

Doing a diff -bB shows that the Qemu version is just a stripped version of the original NetBSD header, with many macros removed, but no new ones added.

Cc Stefano Stabellini <[email protected]>