From 07caea315a85ebfe90851f9c2e4ef3fdd24117b5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 25 Sep 2009 03:53:51 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- hw/ppc_prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/ppc_prep.c') diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index 889284a239..104874f2f8 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -697,7 +697,7 @@ static void ppc_prep_init (ram_addr_t ram_size, if (strcmp(nd_table[i].model, "ne2k_isa") == 0) { isa_ne2000_init(ne2000_io[i], ne2000_irq[i], &nd_table[i]); } else { - pci_nic_init(&nd_table[i], "ne2k_pci", NULL); + pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL); } } -- cgit v1.2.1