]> git.proxmox.com Git - mirror_qemu.git/commit - net.c
Fix pci_add nic not to exit on bad model
authorMarkus Armbruster <armbru@redhat.com>
Fri, 25 Sep 2009 01:53:51 +0000 (03:53 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 5 Oct 2009 14:32:53 +0000 (09:32 -0500)
commit07caea315a85ebfe90851f9c2e4ef3fdd24117b5
tree153e42950d500a7c6219539941ff7c1f81a6487b
parent9ee05825d9eaf7fe3aaed5ed04b83612ede704a0
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>
15 files changed:
hw/mips_malta.c
hw/pc.c
hw/pci.c
hw/pci.h
hw/ppc440_bamboo.c
hw/ppc_newworld.c
hw/ppc_oldworld.c
hw/ppc_prep.c
hw/ppce500_mpc8544ds.c
hw/r2d.c
hw/realview.c
hw/sun4u.c
hw/versatilepb.c
net.c
net.h