cbdfe66
From 8a881734bccddf707a42ba2effff699b824d3c8f Mon Sep 17 00:00:00 2001
cbdfe66
From: Amit Shah <amit.shah@redhat.com>
cbdfe66
Date: Thu, 25 Feb 2010 18:41:16 +0530
cbdfe66
Subject: [PATCH] virtio-serial: pci: Allow MSI to be disabled
cbdfe66
cbdfe66
Michael noted we don't allow disabling of MSI for the virtio-serial-pci
cbdfe66
device. Fix that.
cbdfe66
cbdfe66
Upstream commit: 7b665b668aa92bf0bba696f085dff87539d95529
cbdfe66
cbdfe66
Signed-off-by: Amit Shah <amit.shah@redhat.com>
cbdfe66
CC: "Michael S. Tsirkin" <mst@redhat.com>
cbdfe66
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cbdfe66
---
cbdfe66
 hw/virtio-pci.c |    6 +++---
cbdfe66
 1 files changed, 3 insertions(+), 3 deletions(-)
cbdfe66
cbdfe66
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
cbdfe66
index 9a02682..636c8c3 100644
cbdfe66
--- a/hw/virtio-pci.c
cbdfe66
+++ b/hw/virtio-pci.c
cbdfe66
@@ -598,8 +598,8 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
cbdfe66
     if (!vdev) {
cbdfe66
         return -1;
cbdfe66
     }
cbdfe66
-    vdev->nvectors = proxy->nvectors ? proxy->nvectors
cbdfe66
-                                     : proxy->max_virtserial_ports + 1;
cbdfe66
+    vdev->nvectors = proxy->nvectors == -1 ? proxy->max_virtserial_ports + 1
cbdfe66
+                                           : proxy->nvectors;
cbdfe66
     virtio_init_pci(proxy, vdev,
cbdfe66
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
cbdfe66
                     PCI_DEVICE_ID_VIRTIO_CONSOLE,
cbdfe66
@@ -683,7 +683,7 @@ static PCIDeviceInfo virtio_info[] = {
cbdfe66
         .init      = virtio_serial_init_pci,
cbdfe66
         .exit      = virtio_exit_pci,
cbdfe66
         .qdev.props = (Property[]) {
cbdfe66
-            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
cbdfe66
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, -1),
cbdfe66
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
cbdfe66
             DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
cbdfe66
             DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
cbdfe66
-- 
cbdfe66
1.6.6.1
cbdfe66