aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-06-18 15:14:08 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-22 10:15:29 -0500
commit5607c38820366954c38dd702e979499486057481 (patch)
tree9d7f6624fc7b24c6eb887d4b634f57cb6f2b33f1 /net.c
parentFix do_pci_register_device() to reject devfn already in use (diff)
downloadqemu-kvm-5607c38820366954c38dd702e979499486057481.tar.gz
qemu-kvm-5607c38820366954c38dd702e979499486057481.tar.bz2
qemu-kvm-5607c38820366954c38dd702e979499486057481.zip
Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into struct NICinfo. Use it in pci_nic_init(), and remove arguments bus and devfn. Don't support addr= in third argument of monitor command pci_add, because that clashes with its first argument. Admittedly unelegant. Machines "malta" and "r2d" have a default NIC with a well-known PCI address. Deal with that the same way as the NIC model: make pci_nic_init() take an optional default to be used when the user doesn't specify one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net.c b/net.c
index 9f9e3632a..5b092c748 100644
--- a/net.c
+++ b/net.c
@@ -2103,7 +2103,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", NULL
+ "vlan", "name", "macaddr", "model", "addr", NULL
};
NICInfo *nd;
uint8_t *macaddr;
@@ -2138,6 +2138,9 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
if (get_param_value(buf, sizeof(buf), "model", p)) {
nd->model = strdup(buf);
}
+ if (get_param_value(buf, sizeof(buf), "addr", p)) {
+ nd->devaddr = strdup(buf);
+ }
nd->vlan = vlan;
nd->name = name;
nd->used = 1;