aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-08-12 12:47:24 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-24 08:46:48 -0500
commit177539e06d23f8a5dbbeb1a5e3ab56a96654221e (patch)
tree9deb21e2a1d51acb1f27eb474aa3024921f07050 /hw/virtio-pci.c
parentaa7116cbc814cda42c962361af4e1fb0c4aaf9ff (diff)
virtio-blk: add msi support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 8b57dfcb13..e95700a485 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -437,10 +437,13 @@ static void virtio_blk_init_pci(PCIDevice *pci_dev)
fprintf(stderr, "drive property not set\n");
}
vdev = virtio_blk_init(&pci_dev->qdev, proxy->dinfo);
+ vdev->nvectors = proxy->nvectors;
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BLOCK,
proxy->class_code, 0x00);
+ /* make the actual value visible */
+ proxy->nvectors = vdev->nvectors;
}
static void virtio_console_init_pci(PCIDevice *pci_dev)
@@ -504,6 +507,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
DEFINE_PROP_DRIVE("drive", VirtIOPCIProxy, dinfo),
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
DEFINE_PROP_END_OF_LIST(),
},
},{
@@ -511,8 +515,8 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_net_init_pci,
.qdev.props = (Property[]) {
- DEFINE_PROP_HEX32("vectors", VirtIOPCIProxy, nvectors,
- NIC_NVECTORS_UNSPECIFIED),
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
+ NIC_NVECTORS_UNSPECIFIED),
DEFINE_PROP_END_OF_LIST(),
},
},{