From 4559a1dbcc15a10482de822e2839645a1819ef6f Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 20 Apr 2012 16:50:25 -0300 Subject: net: net_client_init(): use error_set() Callers are changed to use qerror_report_err() to keep their QError semantics. Signed-off-by: Luiz Capitulino Reviewed-By: Laszlo Ersek --- hw/usb/dev-network.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hw/usb/dev-network.c') diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 4e26e64d63..5d2f0982c9 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1356,6 +1356,7 @@ static int usb_net_initfn(USBDevice *dev) static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) { + Error *local_err = NULL; USBDevice *dev; QemuOpts *opts; int idx; @@ -1367,8 +1368,10 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) qemu_opt_set(opts, "type", "nic"); qemu_opt_set(opts, "model", "usb"); - idx = net_client_init(opts, 0); - if (idx == -1) { + idx = net_client_init(opts, 0, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); return NULL; } -- cgit v1.2.3