diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-06-21 19:51:18 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-24 09:09:15 -0500 |
commit | ffe6370c9f2a596814bf14e472910fe6ef7e001d (patch) | |
tree | a8eae458eecbafcfffa07bb196839ea2c37cbafe /net.c | |
parent | 566e2d3e880c5fba6342b78b2aedf04427e18237 (diff) | |
download | qemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.zip qemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.tar.gz qemu-ffe6370c9f2a596814bf14e472910fe6ef7e001d.tar.bz2 |
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 'net.c')
-rw-r--r-- | net.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -2169,7 +2169,7 @@ int net_client_init(Monitor *mon, const char *device, const char *p) } if (!strcmp(device, "nic")) { static const char * const nic_params[] = { - "vlan", "name", "macaddr", "model", "addr", NULL + "vlan", "name", "macaddr", "model", "addr", "vectors", NULL }; NICInfo *nd; uint8_t *macaddr; @@ -2207,6 +2207,22 @@ int net_client_init(Monitor *mon, const char *device, const char *p) if (get_param_value(buf, sizeof(buf), "addr", p)) { nd->devaddr = strdup(buf); } + nd->nvectors = NIC_NVECTORS_UNSPECIFIED; + if (get_param_value(buf, sizeof(buf), "vectors", p)) { + char *endptr; + long vectors = strtol(buf, &endptr, 0); + if (*endptr) { + config_error(mon, "invalid syntax for # of vectors\n"); + ret = -1; + goto out; + } + if (vectors < 0 || vectors > 0x7ffffff) { + config_error(mon, "invalid # of vectors\n"); + ret = -1; + goto out; + } + nd->nvectors = vectors; + } nd->vlan = vlan; nd->name = name; nd->used = 1; |