hw/mips: Improve the default USB settings in the loongson3-virt machine
PATCH v3 1/1 hw/mips: Improve the default USB settings in the loongson3-virt machine
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.
---
v3: Back to runtime detection, but more simple this time compared to v1
(checking for OHCI should be enough, since this implies CONFIG_USB
which is the switch that usb-kbd and usb-tablet are depending on)
hw/mips/loongson3_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mips/loongson3_virt.c +1 -1
@@ -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" );
Signature · 1 line
2.39.3
Quoted 6 lines · Thomas Huth
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.
Quoted 8 lines
Signed-off-by Thomas Huth <[email protected]>---
v3: Back to runtime detection, but more simple this time compared to v1
(checking for OHCI should be enough, since this impliesCONFIG_USB
which is the switch that usb-kbd and usb-tablet are depending on)hw/mips/loongson3_virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
And queued to mips-fixes, thanks!