summaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-11-24 16:45:35 +0200
committerMichael S. Tsirkin <mst@redhat.com>2009-12-01 17:58:48 +0200
commit1b8e9b274287ea7e2256244e62ed285b7d83e0ad (patch)
tree8931a2e82e02746b51d4c059e9bb5653c1177d44 /hw/virtio-pci.c
parentb5f28bcaeec3ca54755f24ae665c4028fc598d77 (diff)
virtio: do not reset msix state on soft reset
msix state is managed by OS, not the driver, so it's wrong to touch it on io from driver. Mark all vectors unused instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index aebcf9d0d1..d222ce03fe 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -185,8 +185,10 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
break;
case VIRTIO_PCI_QUEUE_PFN:
pa = (target_phys_addr_t)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT;
- if (pa == 0)
- virtio_pci_reset(&proxy->pci_dev.qdev);
+ if (pa == 0) {
+ virtio_reset(proxy->vdev);
+ msix_unuse_all_vectors(&proxy->pci_dev);
+ }
else
virtio_queue_set_addr(vdev, vdev->queue_sel, pa);
break;
@@ -199,8 +201,10 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
break;
case VIRTIO_PCI_STATUS:
vdev->status = val & 0xFF;
- if (vdev->status == 0)
- virtio_pci_reset(&proxy->pci_dev.qdev);
+ if (vdev->status == 0) {
+ virtio_reset(proxy->vdev);
+ msix_unuse_all_vectors(&proxy->pci_dev);
+ }
break;
case VIRTIO_MSI_CONFIG_VECTOR:
msix_vector_unuse(&proxy->pci_dev, vdev->config_vector);