virtio-blk: add msi support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
aa7116cbc8
commit
177539e06d
4
hw/pc.c
4
hw/pc.c
|
@ -1495,6 +1495,10 @@ static QEMUMachine pc_machine_v0_10 = {
|
||||||
.driver = "virtio-net-pci",
|
.driver = "virtio-net-pci",
|
||||||
.property = "vectors",
|
.property = "vectors",
|
||||||
.value = stringify(0),
|
.value = stringify(0),
|
||||||
|
},{
|
||||||
|
.driver = "virtio-blk-pci",
|
||||||
|
.property = "vectors",
|
||||||
|
.value = stringify(0),
|
||||||
},
|
},
|
||||||
{ /* end of list */ }
|
{ /* end of list */ }
|
||||||
},
|
},
|
||||||
|
|
|
@ -437,10 +437,13 @@ static void virtio_blk_init_pci(PCIDevice *pci_dev)
|
||||||
fprintf(stderr, "drive property not set\n");
|
fprintf(stderr, "drive property not set\n");
|
||||||
}
|
}
|
||||||
vdev = virtio_blk_init(&pci_dev->qdev, proxy->dinfo);
|
vdev = virtio_blk_init(&pci_dev->qdev, proxy->dinfo);
|
||||||
|
vdev->nvectors = proxy->nvectors;
|
||||||
virtio_init_pci(proxy, vdev,
|
virtio_init_pci(proxy, vdev,
|
||||||
PCI_VENDOR_ID_REDHAT_QUMRANET,
|
PCI_VENDOR_ID_REDHAT_QUMRANET,
|
||||||
PCI_DEVICE_ID_VIRTIO_BLOCK,
|
PCI_DEVICE_ID_VIRTIO_BLOCK,
|
||||||
proxy->class_code, 0x00);
|
proxy->class_code, 0x00);
|
||||||
|
/* make the actual value visible */
|
||||||
|
proxy->nvectors = vdev->nvectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_console_init_pci(PCIDevice *pci_dev)
|
static void virtio_console_init_pci(PCIDevice *pci_dev)
|
||||||
|
@ -504,6 +507,7 @@ static PCIDeviceInfo virtio_info[] = {
|
||||||
.qdev.props = (Property[]) {
|
.qdev.props = (Property[]) {
|
||||||
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
|
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
|
||||||
DEFINE_PROP_DRIVE("drive", VirtIOPCIProxy, dinfo),
|
DEFINE_PROP_DRIVE("drive", VirtIOPCIProxy, dinfo),
|
||||||
|
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
|
@ -511,8 +515,8 @@ static PCIDeviceInfo virtio_info[] = {
|
||||||
.qdev.size = sizeof(VirtIOPCIProxy),
|
.qdev.size = sizeof(VirtIOPCIProxy),
|
||||||
.init = virtio_net_init_pci,
|
.init = virtio_net_init_pci,
|
||||||
.qdev.props = (Property[]) {
|
.qdev.props = (Property[]) {
|
||||||
DEFINE_PROP_HEX32("vectors", VirtIOPCIProxy, nvectors,
|
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
|
||||||
NIC_NVECTORS_UNSPECIFIED),
|
NIC_NVECTORS_UNSPECIFIED),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
|
|
Loading…
Reference in a new issue