Skip to contentSkip to conversation

Don't notify virtio devices before S_DRIVER_OK

PATCH Applied Mark McLoughlin 2 participants 3 messages Jan 29, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't notify virtio devices before S_DRIVER_OK

Current Linux guests oops if the host notifies of a config change before a driver has been bound to the device.

It's pretty pointless for us to do notify of config changes before status is S_DRIVER_OK anyway, so let's just not do it.

---
 qemu/hw/virtio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
qemu/hw/virtio.c +3 -0
index 35f4669..78bcc2e 100644
@@ -738,6 +738,9 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
 
 void virtio_notify_config(VirtIODevice *vdev)
 {
+    if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK))
+        return;
+
     vdev->isr |= 0x03;
     virtio_update_irq(vdev);
 }
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 10 lines · Mark McLoughlin

Current Linux guests oops if the host notifies of a config change before a driver has been bound to the device.

It's pretty pointless for us to do notify of config changes before status is S_DRIVER_OK anyway, so let's just not do it.

Applied. Thanks.

Please don't send patches against kvm-userspace though.

Regards,

Anthony Liguori

Quoted 19 lines
---
 qemu/hw/virtio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
qemu/hw/virtio.c +3 -0
index 35f4669..78bcc2e 100644
@@ -738,6 +738,9 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
 
 void virtio_notify_config(VirtIODevice *vdev)
 {
+    if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK))
+        return;
+
     vdev->isr |= 0x03;
     virtio_update_irq(vdev);
 }
#2 lore raw
Quoted 9 lines · Anthony Liguori
Quoted 8 lines · Mark McLoughlin

Current Linux guests oops if the host notifies of a config change before a driver has been bound to the device.

It's pretty pointless for us to do notify of config changes before status is S_DRIVER_OK anyway, so let's just not do it.

Quoted 5 lines
Quoted 2 lines

Applied. Thanks.

Please don't send patches against kvm-userspace though.

Yep, sorry - I usually don't, just slipped my mind.

Thanks,
Mark.