From 3bc36a401e0f33e63a4d2c58b646ddf78efb567c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 4 Feb 2015 13:28:09 +0100 Subject: usb: Improve -usbdevice error reporting a bit Most LegacyUSBFactory usbdevice_init() methods realize with qdev_init_nofail(), even though their caller usbdevice_create() can handle failure. Okay if it really can't fail (I didn't check), but somewhat brittle. usb_msd_init() and usb_bt_init() call qdev_init(). The latter additionally reports an error when qdev_init() fails. Realization failure produces multiple error reports: a specific one from qdev_init(), and generic ones from usb_bt_init(), usb_create_simple(), usbdevice_create() and usb_parse(). Remove realization from the usbdevice_init() methods. Realize in usbdevice_create(), and produce exactly one error message there. You still get another one from usb_parse(). Signed-off-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- hw/usb/host-legacy.c | 1 - 1 file changed, 1 deletion(-) (limited to 'hw/usb/host-legacy.c') diff --git a/hw/usb/host-legacy.c b/hw/usb/host-legacy.c index 3cc9c42..422ed9a 100644 --- a/hw/usb/host-legacy.c +++ b/hw/usb/host-legacy.c @@ -128,7 +128,6 @@ USBDevice *usb_host_device_open(USBBus *bus, const char *devname) qdev_prop_set_uint32(&dev->qdev, "hostaddr", filter.addr); qdev_prop_set_uint32(&dev->qdev, "vendorid", filter.vendor_id); qdev_prop_set_uint32(&dev->qdev, "productid", filter.product_id); - qdev_init_nofail(&dev->qdev); return dev; fail: -- cgit v1.1