summaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-01-20 00:36:58 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2010-01-20 08:25:23 -0600
commita1829205a5e4b766b67b843f12cb8235d2387b35 (patch)
treec86de90ff1fc320430ff54a8c4884aedb1078cbd /hw/virtio-pci.c
parent4d3053a3c68e25b813db65394ca3e6d32dbc50a7 (diff)
virtio-serial: Use MSI vectors for port virtqueues
This commit enables the use of MSI interrupts for virtqueue notifications for ports. We use nr_ports + 1 (for control channel) msi entries for the ports, as only the in_vq operations need an interrupt on the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index e7fabfb16b..709d13e4ce 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -499,10 +499,13 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
if (!vdev) {
return -1;
}
+ vdev->nvectors = proxy->nvectors ? proxy->nvectors
+ : proxy->max_virtserial_ports + 1;
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_CONSOLE,
proxy->class_code, 0x00);
+ proxy->nvectors = vdev->nvectors;
return 0;
}
@@ -581,6 +584,7 @@ static PCIDeviceInfo virtio_info[] = {
.init = virtio_serial_init_pci,
.exit = virtio_exit_pci,
.qdev.props = (Property[]) {
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,