Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit cf191a1

Browse files
committed
virtio-pci: Correctly expose vector count for virtio-rng-pci
The vector count should be 1 + the number of virtqueues which is one for virtio-rng. The other PCI devices correctly define this property and default value. This will then enable the use of MSI-X which prevents the kernel from falling back to legacy interrupts which we do not support. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
1 parent 4728f53 commit cf191a1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

hw/virtio/virtio-pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,11 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
24892489
NULL);
24902490
}
24912491

2492+
static Property virtio_rng_pci_properties[] = {
2493+
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
2494+
DEFINE_PROP_END_OF_LIST(),
2495+
};
2496+
24922497
static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
24932498
{
24942499
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -2498,6 +2503,7 @@ static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
24982503
k->realize = virtio_rng_pci_realize;
24992504
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
25002505

2506+
dc->props = virtio_rng_pci_properties;
25012507
pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
25022508
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_RNG;
25032509
pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;

0 commit comments

Comments
 (0)