Patchwork [RFC,v9,12/27] virtio-blk: Add workaround for BUG_ON() dependency in virtio_ring.h

login
register
mail settings
Submitter Stefan Hajnoczi
Date July 18, 2012, 3:07 p.m.
Message ID <1342624074-24650-13-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/171717/
State New
Headers show

Comments

Stefan Hajnoczi - July 18, 2012, 3:07 p.m.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/dataplane/vring.h |    5 +++++
 1 file changed, 5 insertions(+)
Michael S. Tsirkin - July 18, 2012, 7:03 p.m.
On Wed, Jul 18, 2012 at 04:07:39PM +0100, Stefan Hajnoczi wrote:
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
>  hw/dataplane/vring.h |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/dataplane/vring.h b/hw/dataplane/vring.h
> index 3eab4b4..44ef4a9 100644
> --- a/hw/dataplane/vring.h
> +++ b/hw/dataplane/vring.h
> @@ -1,6 +1,11 @@
>  #ifndef VRING_H
>  #define VRING_H
>  
> +/* Some virtio_ring.h files use BUG_ON() */

It's a bug then. Do we really need to work around broken systems?
If yes let's just ship our own headers ...

> +#ifndef BUG_ON
> +#define BUG_ON(x)
> +#endif
> +
>  #include <linux/virtio_ring.h>
>  #include "qemu-common.h"
>  
> -- 
> 1.7.10.4

Patch

diff --git a/hw/dataplane/vring.h b/hw/dataplane/vring.h
index 3eab4b4..44ef4a9 100644
--- a/hw/dataplane/vring.h
+++ b/hw/dataplane/vring.h
@@ -1,6 +1,11 @@ 
 #ifndef VRING_H
 #define VRING_H
 
+/* Some virtio_ring.h files use BUG_ON() */
+#ifndef BUG_ON
+#define BUG_ON(x)
+#endif
+
 #include <linux/virtio_ring.h>
 #include "qemu-common.h"