summaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index b649360dd3..1f73a5216f 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -585,6 +585,13 @@ USBDevice *usbdevice_create(const char *cmdline)
return NULL;
}
+ if (!bus) {
+ error_report("Error: no usb bus to attach usbdevice %s, "
+ "please try -machine usb=on and check that "
+ "the machine model supports USB", driver);
+ return NULL;
+ }
+
if (!f->usbdevice_init) {
if (*params) {
error_report("usbdevice %s accepts no params", driver);