diff options
author | Markus Armbruster <armbru@redhat.com> | 2009-09-25 03:53:51 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-05 09:32:53 -0500 |
commit | 07caea315a85ebfe90851f9c2e4ef3fdd24117b5 (patch) | |
tree | 153e42950d500a7c6219539941ff7c1f81a6487b /net.h | |
parent | 9ee05825d9eaf7fe3aaed5ed04b83612ede704a0 (diff) | |
download | qemu-07caea315a85ebfe90851f9c2e4ef3fdd24117b5.tar.gz |
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>
Diffstat (limited to 'net.h')
-rw-r--r-- | net.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -75,9 +75,10 @@ ssize_t qemu_send_packet_async(VLANClientState *vc, const uint8_t *buf, void qemu_purge_queued_packets(VLANClientState *vc); void qemu_flush_queued_packets(VLANClientState *vc); void qemu_format_nic_info_str(VLANClientState *vc, uint8_t macaddr[6]); +int qemu_show_nic_models(const char *arg, const char *const *models); void qemu_check_nic_model(NICInfo *nd, const char *model); -int qemu_check_nic_model_list(NICInfo *nd, const char * const *models, - const char *default_model); +int qemu_find_nic_model(NICInfo *nd, const char * const *models, + const char *default_model); void qemu_handler_true(void *opaque); void do_info_network(Monitor *mon); |