Commit 7625162ca4e7be6359571d98b1c9e983393e9d91

Authored by aliguori
1 parent 22bf1458

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.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6471 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 0 deletions
hw/virtio.c
... ... @@ -738,6 +738,9 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
738 738  
739 739 void virtio_notify_config(VirtIODevice *vdev)
740 740 {
  741 + if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK))
  742 + return;
  743 +
741 744 vdev->isr |= 0x03;
742 745 virtio_update_irq(vdev);
743 746 }
... ...