diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-04 13:28:09 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-02-18 10:53:10 +0100 |
commit | 3bc36a401e0f33e63a4d2c58b646ddf78efb567c (patch) | |
tree | 439eaf7ecad20dfb4607565c041d19140d43c45f /hw/usb/dev-serial.c | |
parent | 4806ec9b2c57ff42a91d5419ac1137fffd1c9fb5 (diff) |
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 <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-serial.c')
-rw-r--r-- | hw/usb/dev-serial.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index f347c05b54..67c2072ce7 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -549,8 +549,6 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename) qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid); if (productid) qdev_prop_set_uint16(&dev->qdev, "productid", productid); - qdev_init_nofail(&dev->qdev); - return dev; } @@ -565,8 +563,6 @@ static USBDevice *usb_braille_init(USBBus *bus, const char *unused) dev = usb_create(bus, "usb-braille"); qdev_prop_set_chr(&dev->qdev, "chardev", cdrv); - qdev_init_nofail(&dev->qdev); - return dev; } |