[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 09/10] Always use eventfd as notifying mechanism
From: |
Eric Auger |
Subject: |
[Qemu-devel] [RFC v3 09/10] Always use eventfd as notifying mechanism |
Date: |
Mon, 2 Jun 2014 08:49:33 +0100 |
From: Alvise Rigo <address@hidden>
When eventfd is not configured the method event_notifier_init fallbacks
to the pipe/pipe2 system call, causing an error in VFIO_DEVICE_SET_IRQS
since we pass to the kernel a file descriptor which is not created by
eventfd.
Signed-off-by: Alvise Rigo <address@hidden>
---
hw/vfio/platform.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 377783b..56dde5f 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -346,6 +346,11 @@ static int vfio_enable_intp(VFIODevice *vdev, unsigned int
index)
sysbus_init_irq(sbdev, &intp->qemuirq);
ret = event_notifier_init(&intp->interrupt, 0);
+ if (!ret && (intp->interrupt.rfd != intp->interrupt.wfd)) {
+ /* event_notifier_init created a pipe instead of eventfd */
+ ret = -1;
+ }
+
if (ret) {
error_report("vfio: Error: event_notifier_init failed ");
return ret;
--
1.8.3.2
[Qemu-devel] [RFC v3 06/10] virt: Assign a VFIO platform device with -device option, Eric Auger, 2014/06/02
Re: [Qemu-devel] [RFC v3 06/10] virt: Assign a VFIO platform device with -device option, Peter Maydell, 2014/06/25