diff mbox

[18/39] ivshmem: add a warning if eventfd value is 0

Message ID 1435330185-23248-19-git-send-email-marcandre.lureau@gmail.com
State New
Headers show

Commit Message

Marc-André Lureau June 26, 2015, 2:49 p.m. UTC
This should not happen according to eventfd(2).

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
 hw/misc/ivshmem.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 17dc122..6f3d2fe 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -267,6 +267,7 @@  static void ivshmem_receive(void *opaque, const uint8_t *buf, int size)
     IVShmemState *s = opaque;
 
     IVSHMEM_DPRINTF("ivshmem_receive 0x%02x size: %d\n", *buf, size);
+    g_warn_if_fail(*buf != 0);
 
     ivshmem_IntrStatus_write(s, *buf);
 }