Re: [PATCH 16/16] util/vfio-helpers: Remove now unused qemu_vfio_pci_init_irq()

2020-10-22 Thread Stefan Hajnoczi
On Tue, Oct 20, 2020 at 07:24:28PM +0200, Philippe Mathieu-Daudé wrote:
> Our only user, the NVMe block driver, switched to the MSIX API.
> As this function is now unused, remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> ---
>  include/qemu/vfio-helpers.h |  2 --
>  util/vfio-helpers.c | 43 -
>  2 files changed, 45 deletions(-)

Reviewed-by: Stefan Hajnoczi 


signature.asc
Description: PGP signature


[PATCH 16/16] util/vfio-helpers: Remove now unused qemu_vfio_pci_init_irq()

2020-10-20 Thread Philippe Mathieu-Daudé
Our only user, the NVMe block driver, switched to the MSIX API.
As this function is now unused, remove it.

Signed-off-by: Philippe Mathieu-Daudé 
---
 include/qemu/vfio-helpers.h |  2 --
 util/vfio-helpers.c | 43 -
 2 files changed, 45 deletions(-)

diff --git a/include/qemu/vfio-helpers.h b/include/qemu/vfio-helpers.h
index 4c06694e03a..f42371d25d6 100644
--- a/include/qemu/vfio-helpers.h
+++ b/include/qemu/vfio-helpers.h
@@ -29,8 +29,6 @@ void *qemu_vfio_pci_map_bar(QEMUVFIOState *s, int index,
 Error **errp);
 void qemu_vfio_pci_unmap_bar(QEMUVFIOState *s, int index, void *bar,
  uint64_t offset, uint64_t size);
-int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier *e,
-   int irq_type, Error **errp);
 int qemu_vfio_pci_msix_init_irqs(QEMUVFIOState *s,
  unsigned *irq_count, Error **errp);
 int qemu_vfio_pci_msix_set_irq(QEMUVFIOState *s, unsigned irq_index,
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index 18142e6be86..83d6eef13fb 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -189,49 +189,6 @@ void qemu_vfio_pci_unmap_bar(QEMUVFIOState *s, int index, 
void *bar,
 }
 }
 
-/**
- * Initialize device IRQ with @irq_type and register an event notifier.
- */
-int qemu_vfio_pci_init_irq(QEMUVFIOState *s, EventNotifier *e,
-   int irq_type, Error **errp)
-{
-int r;
-struct vfio_irq_set *irq_set;
-size_t irq_set_size;
-struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) };
-
-irq_info.index = irq_type;
-if (ioctl(s->device, VFIO_DEVICE_GET_IRQ_INFO, _info)) {
-error_setg_errno(errp, errno, "Failed to get device interrupt info");
-return -errno;
-}
-if (!(irq_info.flags & VFIO_IRQ_INFO_EVENTFD)) {
-error_setg(errp, "Device interrupt doesn't support eventfd");
-return -EINVAL;
-}
-
-irq_set_size = sizeof(*irq_set) + sizeof(int);
-irq_set = g_malloc0(irq_set_size);
-
-/* Get to a known IRQ state */
-*irq_set = (struct vfio_irq_set) {
-.argsz = irq_set_size,
-.flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER,
-.index = irq_info.index,
-.start = 0,
-.count = 1,
-};
-
-*(int *)_set->data = event_notifier_get_fd(e);
-r = ioctl(s->device, VFIO_DEVICE_SET_IRQS, irq_set);
-g_free(irq_set);
-if (r) {
-error_setg_errno(errp, errno, "Failed to setup device interrupt");
-return -errno;
-}
-return 0;
-}
-
 /**
  * Initialize a MSIX IRQ and register its event notifier.
  * @irq_index: MSIX IRQ index
-- 
2.26.2