qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Cc: alex.bennee@linaro.org, bill.mills@linaro.org, edgar.iglesias@amd.com
Subject: [PATCH v1 1/5] virtio: Introduce notify_queue
Date: Tue, 28 Oct 2025 16:23:46 +0100	[thread overview]
Message-ID: <20251028152351.1247812-2-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <20251028152351.1247812-1-edgar.iglesias@gmail.com>

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/virtio/virtio.c             | 7 +++++++
 include/hw/virtio/virtio-bus.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 153ee0a0cf..8a53fb5f93 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2700,12 +2700,19 @@ static void virtio_irq(VirtQueue *vq)
 
 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
 {
+    BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
+    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
+
     WITH_RCU_READ_LOCK_GUARD() {
         if (!virtio_should_notify(vdev, vq)) {
             return;
         }
     }
 
+    if (k->notify_queue) {
+        k->notify_queue(qbus->parent, virtio_get_queue_index(vq));
+    }
+
     trace_virtio_notify(vdev, vq);
     virtio_irq(vq);
 }
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index 7ab8c9dab0..043dbeb4cf 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -39,6 +39,7 @@ DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass,
 struct VirtioBusClass {
     /* This is what a VirtioBus must implement */
     BusClass parent;
+    void (*notify_queue)(DeviceState *d, uint16_t index);
     void (*notify)(DeviceState *d, uint16_t vector);
     void (*save_config)(DeviceState *d, QEMUFile *f);
     void (*save_queue)(DeviceState *d, int n, QEMUFile *f);
-- 
2.43.0



  reply	other threads:[~2025-10-28 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 15:23 [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` Edgar E. Iglesias [this message]
2025-11-05 12:38   ` [PATCH v1 1/5] virtio: Introduce notify_queue Alex Bennée
2025-11-13 20:43     ` Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 2/5] virtio: Add virtio_queue_get_rings Edgar E. Iglesias
2025-11-05 12:39   ` Alex Bennée
2025-10-28 15:23 ` [PATCH v1 3/5] virtio: Add the virtio-msg transport Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 4/5] hw/misc: Add generic virtio-msg AMP PCI device Edgar E. Iglesias
2025-10-28 15:23 ` [PATCH v1 5/5] docs: Describe virtio-msg-amp-pci Edgar E. Iglesias
2025-11-05 19:52   ` Alex Bennée
2025-10-28 15:30 ` [PATCH v1 0/5] virtio: Add the virtio-msg transport Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251028152351.1247812-2-edgar.iglesias@gmail.com \
    --to=edgar.iglesias@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=bill.mills@linaro.org \
    --cc=edgar.iglesias@amd.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).