[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 41/43] usb: fail usbdevice_create() when there is no
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 41/43] usb: fail usbdevice_create() when there is no USB bus |
Date: |
Mon, 3 Dec 2012 16:44:38 -0600 |
From: Stefan Hajnoczi <address@hidden>
Report an error instead of segfaulting when attaching a USB device to a
machine with no USB busses:
$ qemu-system-arm -machine vexpress-a9 \
-sd Fedora-17-armhfp-vexpress-mmcblk0.img \
-kernel vmlinuz-3.4.2-3.fc17.armv7hl \
-initrd initramfs-3.4.2-3.fc17.armv7hl.img \
-usbdevice disk:format=raw:test.img
Note that the vexpress-a9 machine does not have a USB host controller.
Reported-by: David Abdurachmanov <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
(cherry picked from commit c128d6a6d785eb9235a4f6dbd52f405ab8c60bee)
Signed-off-by: Michael Roth <address@hidden>
---
hw/usb/bus.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index b649360..1f73a52 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);
--
1.7.9.5
- [Qemu-devel] [PATCH 27/43] tci: Fix type of tci_read_label, (continued)
- [Qemu-devel] [PATCH 27/43] tci: Fix type of tci_read_label, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 26/43] qcow2: Fix refcount table size calculation, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 34/43] qapi: fix qapi_dealloc_type_size parameter type, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 33/43] qapi: handle visitor->type_size() in QapiDeallocVisitor, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 35/43] iscsi: fix segfault in url parsing, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 37/43] iscsi: do not assume device is zero initialized, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 36/43] iscsi: fix deadlock during login, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 39/43] virtio-scsi: Fix subtle (guest) endian bug, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 40/43] qxl: reload memslots after migration, when qxl is in UNDEFINED mode, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 38/43] virtio-scsi: Fix some endian bugs with virtio-scsi, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 41/43] usb: fail usbdevice_create() when there is no USB bus,
Michael Roth <=
- [Qemu-devel] [PATCH 42/43] stream: fix ratelimit_set_speed, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 43/43] e1000: Discard packets that are too long if !SBP and !LPE, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 24/43] target-openrisc: remove conflicting definitions from cpu.h, Michael Roth, 2012/12/03
- [Qemu-devel] [PATCH 25/43] configure: avoid compiler warning in pipe2 detection, Michael Roth, 2012/12/03