aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-05-08 12:34:18 +0200
committerMark McLoughlin <markmc@redhat.com>2009-06-09 11:38:49 +0100
commit10ae5a7a98f7c1d901fbb6658324e9c4c4fec8cf (patch)
tree7bc3ce8db3cd1efcf8de25c5cc150a5095cc3d46 /hw
parentc8decae2e135d2331268619aa07701c31595b6c9 (diff)
net: Improve parameter error reporting
As host network devices can also be instantiated via the monitor, errors should then be reported to the related monitor instead of stderr. This requires larger refactoring, so this patch starts small with introducing a helper to catch both cases and convert net_client_init as well as net_slirp_redir. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci-hotplug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 4d18ea2fca..abe5bae4ac 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -33,11 +33,12 @@
#include "virtio-blk.h"
#if defined(TARGET_I386) || defined(TARGET_X86_64)
-static PCIDevice *qemu_pci_hot_add_nic(PCIBus *pci_bus, const char *opts)
+static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, PCIBus *pci_bus,
+ const char *opts)
{
int ret;
- ret = net_client_init("nic", opts);
+ ret = net_client_init(mon, "nic", opts);
if (ret < 0)
return NULL;
return pci_nic_init(pci_bus, &nd_table[ret], -1, "rtl8139");
@@ -149,7 +150,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(pci_bus, opts);
+ dev = qemu_pci_hot_add_nic(mon, pci_bus, opts);
else if (strcmp(type, "storage") == 0)
dev = qemu_pci_hot_add_storage(mon, pci_bus, opts);
else