mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qemu/net: flag to control the number of vectors a nic has
Add an option to specify the number of MSI-X vectors for PCI NIC cards. This can also be used to disable MSI-X, for compatibility with old qemu. This option currently only affects virtio cards. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
566e2d3e88
commit
ffe6370c9f
4 changed files with 33 additions and 8 deletions
|
@ -745,7 +745,10 @@ VirtIODevice *virtio_net_init(DeviceState *dev)
|
|||
n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN);
|
||||
|
||||
n->vlans = qemu_mallocz(MAX_VLAN >> 3);
|
||||
n->vdev.nvectors = 3;
|
||||
if (dev->nd->nvectors == NIC_NVECTORS_UNSPECIFIED)
|
||||
n->vdev.nvectors = 3;
|
||||
else
|
||||
n->vdev.nvectors = dev->nd->nvectors;
|
||||
|
||||
register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION,
|
||||
virtio_net_save, virtio_net_load, n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue