aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-hotplug.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 /hw/pci-hotplug.c
parent07b7d05377a5e2b242ef0cce3d461d3284700fc0 (diff)
downloadqemu-5607c38820366954c38dd702e979499486057481.zip
qemu-5607c38820366954c38dd702e979499486057481.tar.gz
qemu-5607c38820366954c38dd702e979499486057481.tar.bz2
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 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 4d49c29..e2b14ca 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -33,15 +33,18 @@
#include "virtio-blk.h"
#if defined(TARGET_I386) || defined(TARGET_X86_64)
-static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, PCIBus *pci_bus,
- const char *opts)
+static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, const char *opts)
{
int ret;
ret = net_client_init(mon, "nic", opts);
if (ret < 0)
return NULL;
- return pci_nic_init(pci_bus, &nd_table[ret], -1, "rtl8139");
+ if (nd_table[ret].devaddr) {
+ monitor_printf(mon, "Parameter addr not supported\n");
+ return NULL;
+ }
+ return pci_nic_init(&nd_table[ret], "rtl8139", NULL);
}
void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts)
@@ -149,7 +152,7 @@ void pci_device_hot_add(Monitor *mon, const char *pci_addr, const char *type,
}
if (strcmp(type, "nic") == 0)
- dev = qemu_pci_hot_add_nic(mon, pci_bus, opts);
+ dev = qemu_pci_hot_add_nic(mon, opts);
else if (strcmp(type, "storage") == 0)
dev = qemu_pci_hot_add_storage(mon, pci_bus, opts);
else