diff mbox

[v2,18/45] ivshmem: add a warning if eventfd value is 0

Message ID 1438043577-28636-19-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau July 28, 2015, 12:32 a.m. UTC
From: Marc-André Lureau <marcandre.lureau@gmail.com>

This should not happen according to eventfd(2).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.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);
 }