[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 1/7] util/vfio-helpers: Store eventfd using int32_t type
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH v2 1/7] util/vfio-helpers: Store eventfd using int32_t type |
Date: |
Thu, 13 Aug 2020 19:29:51 +0200 |
Per the documentation in linux-headers/linux/vfio.h:
VFIO_DEVICE_SET_IRQS
* DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd.
Replace the 'int' by an 'int32_t' to match the documentation.
Fixes: 418026ca43 ("util: Introduce vfio helpers")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
util/vfio-helpers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index e399e330e2..9cb9b553a5 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -193,7 +193,7 @@ int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier
*e,
return -EINVAL;
}
- irq_set_size = sizeof(*irq_set) + sizeof(int);
+ irq_set_size = sizeof(*irq_set) + sizeof(int32_t);
irq_set = g_malloc0(irq_set_size);
/* Get to a known IRQ state */
@@ -205,7 +205,7 @@ int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier
*e,
.count = 1,
};
- *(int *)&irq_set->data = event_notifier_get_fd(e);
+ *(int32_t *)&irq_set->data = event_notifier_get_fd(e);
r = ioctl(s->device, VFIO_DEVICE_SET_IRQS, irq_set);
g_free(irq_set);
if (r) {
--
2.21.3
- [RFC PATCH v2 0/7] util/vfio-helpers: Add support for multiple IRQs, Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 1/7] util/vfio-helpers: Store eventfd using int32_t type,
Philippe Mathieu-Daudé <=
- [RFC PATCH v2 2/7] util/vfio-helpers: Move IRQ 'type' from pci_init_irq() to open_pci(), Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 3/7] util/vfio-helpers: Introduce 'irq_count' variable, Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 4/7] util/vfio-helpers: Check the device allow up to 'irq_count' IRQs, Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 5/7] util/vfio-helpers: Support multiple eventfd, Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 6/7] util/vfio-helpers: Allow to set EventNotifier to particular IRQ, Philippe Mathieu-Daudé, 2020/08/13
- [RFC PATCH v2 7/7] util/vfio-helpers: Allow opening device requesting for multiple IRQs, Philippe Mathieu-Daudé, 2020/08/13