summaryrefslogtreecommitdiff
path: root/hw/versatilepb.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-09-25 03:53:51 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:53 -0500
commite0f1258cd0941030944c99eba18f2ff402cc88ef (patch)
tree153e42950d500a7c6219539941ff7c1f81a6487b /hw/versatilepb.c
parentc4eaeddc7f6576a95b60143b9d1c4b2682b4119c (diff)
downloadqemu-e0f1258cd0941030944c99eba18f2ff402cc88ef.tar.gz
qemu-e0f1258cd0941030944c99eba18f2ff402cc88ef.tar.bz2
qemu-e0f1258cd0941030944c99eba18f2ff402cc88ef.zip
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to create the NIC. When MODEL is unknown or "?", this prints to stderr and terminates the program. Change pci_nic_init() not to treat "?" specially, and to return NULL on failure. Switch uses during startup to new convenience wrapper pci_nic_init_nofail(), which behaves just like pci_nic_init() used to do. Bonus bug fix: we now check for qdev_init() failing there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/versatilepb.c')
-rw-r--r--hw/versatilepb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 29b85ae7b8..e8ebdf1758 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -213,7 +213,7 @@ static void versatile_init(ram_addr_t ram_size,
smc91c111_init(nd, 0x10010000, sic[25]);
done_smc = 1;
} else {
- pci_nic_init(nd, "rtl8139", NULL);
+ pci_nic_init_nofail(nd, "rtl8139", NULL);
}
}
if (usb_enabled) {