Skip to content

Commit

Permalink
hw/mips: Improve the default USB settings in the loongson3-virt machine
Browse files Browse the repository at this point in the history
It's possible to compile QEMU without the USB devices (e.g. when using
"--without-default-devices" as option for the "configure" script).
To be still able to run the loongson3-virt machine in default mode with
such a QEMU binary, we have to check here for the availability of the
OHCI controller first before instantiating the USB devices.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230714104903.284845-1-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
huth authored and philmd committed Jul 25, 2023
1 parent 3b83079 commit 5fc1a68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/mips/loongson3_virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static inline void loongson3_virt_devices_init(MachineState *machine,

pci_vga_init(pci_bus);

if (defaults_enabled()) {
if (defaults_enabled() && object_class_by_name("pci-ohci")) {
pci_create_simple(pci_bus, -1, "pci-ohci");
usb_create_simple(usb_bus_find(-1), "usb-kbd");
usb_create_simple(usb_bus_find(-1), "usb-tablet");
Expand Down

0 comments on commit 5fc1a68

Please sign in to comment.