Skip to contentSkip to conversation

[6471] Don't notify virtio devices before S_DRIVER_OK (Mark McLoughlin)

Qemu-devel Anthony Liguori 1 participant 1 message Jan 29, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6471

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6471
Author:   aliguori
Date:     2009-01-29 17:02:13 +0000 (Thu, 29 Jan 2009)

Log Message:
-----------
Don't notify virtio devices before S_DRIVER_OK (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.

Modified Paths:
--------------
trunk/hw/virtio.c

Modified: trunk/hw/virtio.c
===================================================================

hw/virtio.c +3 -0
@@ -738,6 +738,9 @@
 
 void virtio_notify_config(VirtIODevice *vdev)
 {
+    if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK))
+        return;
+
     vdev->isr |= 0x03;
     virtio_update_irq(vdev);
 }