summary refs log tree commit diff stats
path: root/include/hw/virtio/virtio.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2025-09-22 18:01:46 -0400
committerMichael S. Tsirkin <mst@redhat.com>2025-10-05 09:01:08 -0400
commit1e9181dc5277f27fcda21f64a399f12bbf578e5e (patch)
treeb0529e62432b477b3737dd5be7b6e0f5b8faa4b5 /include/hw/virtio/virtio.h
parent2e41580328a9cdfffce3ee496857c1b2d6ed365e (diff)
downloadfocaccia-qemu-1e9181dc5277f27fcda21f64a399f12bbf578e5e.tar.gz
focaccia-qemu-1e9181dc5277f27fcda21f64a399f12bbf578e5e.zip
virtio: unify virtio_notify_irqfd() and virtio_notify()
The difference between these two functions:
- virtio_notify() uses the interrupt code path (MSI or classic IRQs)
- virtio_notify_irqfd() uses guest notifiers (irqfds)

virtio_notify() can only be called with the BQL held because the
interrupt code path requires the BQL. Device models use
virtio_notify_irqfd() from IOThreads since the BQL is not held.

The two functions can be unified by pushing down the if
(qemu_in_iothread()) check from virtio-blk and virtio-scsi into core
virtio code. This is in preparation for the next commit that will add
irqfd support to virtio_notify_config() and where it's unattractive to
introduce another irqfd-only API for device model callers.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20250922220149.498967-3-stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio/virtio.h')
-rw-r--r--include/hw/virtio/virtio.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 2aeb021fb3..d97529c3f1 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -294,7 +294,6 @@ int virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
                               unsigned int *out_bytes, unsigned max_in_bytes,
                               unsigned max_out_bytes);
 
-void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq);
 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
 
 int virtio_save(VirtIODevice *vdev, QEMUFile *f);