]> git.proxmox.com Git - qemu.git/commitdiff
virtio-pci: fix level interrupts
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 7 May 2013 12:49:58 +0000 (15:49 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 8 May 2013 20:54:21 +0000 (15:54 -0500)
mask notifiers are never called without msix,
so devices with backend masking like vhost don't work.
Call mask notifiers explicitly at
startup/cleanup to make it work.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio/virtio-pci.c

index ec0066b6d41c7dbd9695e192073d9b7da26e0450..113fbd9550c4d1342c6282db3464f03e1889ecee 100644 (file)
@@ -744,6 +744,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
                                          bool with_irqfd)
 {
     VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
+    VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(proxy->vdev);
     VirtQueue *vq = virtio_get_queue(proxy->vdev, n);
     EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
 
@@ -758,6 +759,10 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign,
         event_notifier_cleanup(notifier);
     }
 
+    if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) {
+        vdc->guest_notifier_mask(proxy->vdev, n, !assign);
+    }
+
     return 0;
 }