aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorGal Hammer <ghammer@redhat.com>2013-02-27 15:15:31 +0200
committerMichael S. Tsirkin <mst@redhat.com>2013-02-27 17:24:40 +0200
commit554f1997f0328bc259454239db64b20b3376d9a6 (patch)
treebed45ab9191865a2d33902deafc4e32109424c84 /hw/virtio-pci.c
parent0e98b436eceb9d31caad898f4983a369c76524e0 (diff)
Set virtio-serial device to have a default of 2 MSI vectors.
The virtio-serial device is expected to use 2 MSI vectors, one for control queue and a second shared for all queues. Signed-off-by: Gal Hammer <ghammer@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index a869f535de..ba56ab2d77 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -975,6 +975,9 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
if (!vdev) {
return -1;
}
+
+ /* backwards-compatibility with machines that were created with
+ DEV_NVECTORS_UNSPECIFIED */
vdev->nvectors = proxy->nvectors == DEV_NVECTORS_UNSPECIFIED
? proxy->serial.max_virtserial_ports + 1
: proxy->nvectors;
@@ -1155,7 +1158,7 @@ static const TypeInfo virtio_net_info = {
static Property virtio_serial_properties[] = {
DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
- DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED),
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, serial.max_virtserial_ports, 31),