Make it obvious that pci_nic_init() can't fail
authorMarkus Armbruster <armbru@redhat.com>
Fri, 25 Sep 2009 01:53:50 +0000 (03:53 +0200)
committerMark McLoughlin <markmc@redhat.com>
Mon, 28 Sep 2009 16:23:16 +0000 (17:23 +0100)
commit0ce1af6e7d4b1e2ffa4dedf6d415c4d86a1af490
tree5576b79cf790e6a729b56d9564c8e1ea9036cad6
parent3675a0dde74f890404f392e194f1adc6b24285f7
Make it obvious that pci_nic_init() can't fail

Before this patch, pci_nic_init() returns NULL when it can't find the
model in pci_nic_models[].  Except this can't happen, because
qemu_check_nic_model_list() just searched for model in
pci_nic_models[], and terminated the program on failure.

Repeating the search here is pointless.  Instead, change
qemu_check_nic_model_list() to return the model's array index.

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-nic1.patch
hw/pci.c
net.c
net.h