virtio_error() calls virtio_notify_config() to inject a VIRTIO
Configuration Change Notification. This doesn't work from IOThreads
because the BQL is not held and the interrupt code path requires the
BQL.
Follow the same approach as virtio_notify() and use ->config_notifier
(an irqfd) when called from the IOThread.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <
20250922220149.498967-4-stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio_set_isr(vdev, 0x3);
vdev->generation++;
- virtio_notify_vector(vdev, vdev->config_vector);
+
+ if (qemu_in_iothread()) {
+ defer_call(virtio_notify_irqfd_deferred_fn, &vdev->config_notifier);
+ } else {
+ virtio_notify_vector(vdev, vdev->config_vector);
+ }
}
static bool virtio_device_endian_needed(void *opaque)