mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
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>
This commit is contained in:
parent
9ee05825d9
commit
07caea315a
15 changed files with 71 additions and 32 deletions
|
@ -489,7 +489,7 @@ static void network_init(void)
|
|||
/* The malta board has a PCNet card using PCI SLOT 11 */
|
||||
default_devaddr = "0b";
|
||||
|
||||
pci_nic_init(nd, "pcnet", default_devaddr);
|
||||
pci_nic_init_nofail(nd, "pcnet", default_devaddr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue