aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-17 14:28:03 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-03-17 14:11:43 +0100
commit2e269f3d9d806987977b3c76deb26647f2bf33e1 (patch)
treec6e22365fdc8d6aa109d9d38cd4fd728d2c546ae /hw/usb/bus.c
parentf4bbaaf584ed8d0a430b467bace15f338cba4c57 (diff)
usb: Improve companion configuration error messages
The previous commit broke the additional messages explaining the error messages. Improve the error messages, so they don't need explaining so much. Helps QMP users as well, unlike additional explanations. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 98e33ea31a..375167573d 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -374,16 +374,14 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],
}
}
- if (!bus || !bus->ops->register_companion) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, "masterbus",
- "an USB masterbus");
-#if 0 /* conversion from qerror_report() to error_set() broke this: */
- if (bus) {
- error_printf_unless_qmp(
- "USB bus '%s' does not allow companion controllers\n",
- masterbus);
- }
-#endif
+ if (!bus) {
+ error_setg(errp, "USB bus '%s' not found", masterbus);
+ return;
+ }
+ if (!bus->ops->register_companion) {
+ error_setg(errp, "Can't use USB bus '%s' as masterbus,"
+ " it doesn't support companion controllers",
+ masterbus);
return;
}