virtio/pci: Use consistent naming for the PCI ISR bit flags
Avoid using VIRTIO_IRQ_{HIGH,LOW} which belong to a different
namespace. Instead define VIRTIO_PCI_ISR_QUEUE as a logical extension
of the VIRTIO_PCI_ISR_* namespace. Since this bit flag is missing from
a header imported verbatim from Linux, define it directly in pci.c.
Signed-off-by: Keir Fraser <keirf@google.com>
diff --git a/virtio/pci-legacy.c b/virtio/pci-legacy.c
index 5804796..02a8f8c 100644
--- a/virtio/pci-legacy.c
+++ b/virtio/pci-legacy.c
@@ -61,7 +61,7 @@
case VIRTIO_PCI_ISR:
ioport__write8(data, vpci->isr);
kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_LOW);
- vpci->isr = VIRTIO_IRQ_LOW;
+ vpci->isr = 0;
break;
default:
ret = virtio_pci__specific_data_in(kvm, vdev, data, size, offset);
diff --git a/virtio/pci.c b/virtio/pci.c
index 74bc9a4..8a34cec 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -14,6 +14,9 @@
#include <assert.h>
#include <string.h>
+/* The bit of the ISR which indicates a queue change. */
+#define VIRTIO_PCI_ISR_QUEUE 0x1
+
int virtio_pci__add_msix_route(struct virtio_pci *vpci, u32 vec)
{
int gsi;
@@ -239,7 +242,7 @@
else
kvm__irq_trigger(kvm, vpci->gsis[vq]);
} else {
- vpci->isr |= VIRTIO_IRQ_HIGH;
+ vpci->isr |= VIRTIO_PCI_ISR_QUEUE;
kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_HIGH);
}
return 0;