Fix pci_add nic not to exit on bad modelqemu-0.11.0-2.fc12
authorMarkus Armbruster <armbru@redhat.com>
Fri, 25 Sep 2009 01:53:51 +0000 (03:53 +0200)
committerMark McLoughlin <markmc@redhat.com>
Mon, 28 Sep 2009 16:37:30 +0000 (17:37 +0100)
commit0ba615f4e6ecf13839b7688c762961aa1d092504
tree83077bd7d1ca2f61f711082be8aac0a37a3460e3
parent0ce1af6e7d4b1e2ffa4dedf6d415c4d86a1af490
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.

[markmc:

  - rebase to stable-0.11
  - drop qemu_error() usage
  - go back to pci_create() in pci_nic_init
  - qdev_init() doesn't have an error return
]

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Fedora-patch: qemu-do-not-exit-on-pci-hotplug-invalid-nic2.patch
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