diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-04-20 16:50:25 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2012-06-04 13:49:35 -0300 |
commit | 4559a1dbcc15a10482de822e2839645a1819ef6f (patch) | |
tree | 9890da3db00eaf564e72d51526aa586a266f9143 /hw/usb/dev-network.c | |
parent | 42dcc547e1982f31d0f678e02f0aae5be570384a (diff) | |
download | qemu-4559a1dbcc15a10482de822e2839645a1819ef6f.zip qemu-4559a1dbcc15a10482de822e2839645a1819ef6f.tar.gz qemu-4559a1dbcc15a10482de822e2839645a1819ef6f.tar.bz2 |
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 <lcapitulino@redhat.com>
Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'hw/usb/dev-network.c')
-rw-r--r-- | hw/usb/dev-network.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 4e26e64..5d2f098 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; } |