summaryrefslogtreecommitdiff
path: root/hw/virtio-net.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-06-21 19:51:18 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-24 09:09:15 -0500
commitffe6370c9f2a596814bf14e472910fe6ef7e001d (patch)
treea8eae458eecbafcfffa07bb196839ea2c37cbafe /hw/virtio-net.c
parent566e2d3e880c5fba6342b78b2aedf04427e18237 (diff)
downloadqemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.tar.gz
qemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.tar.bz2
qemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.zip
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>
Diffstat (limited to 'hw/virtio-net.c')
-rw-r--r--hw/virtio-net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 29a1272feb..7a7eafe903 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -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);