Only create default devices when requested, avoid have the
machine implementation to modify the generic 'usb' boolean
set from command line.
Fixes: 4ee9ced979e ("hw/ppc/spapr: simplify usb controller creation logic")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 702f774cda9..bbcb4695d4c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3032,7 +3032,6 @@ static void spapr_machine_init(MachineState *machine)
has_vga = spapr_vga_init(phb->bus, &error_fatal);
if (has_vga) {
spapr->want_stdout_path = !machine->enable_graphics;
- machine->usb |= defaults_enabled() && !machine->usb_disabled;
} else {
spapr->want_stdout_path = true;
}
@@ -3040,7 +3039,7 @@ static void spapr_machine_init(MachineState *machine)
if (machine->usb) {
pci_create_simple(phb->bus, -1, "nec-usb-xhci");
- if (has_vga) {
+ if (has_vga && defaults_enabled()) {
USBBus *usb_bus;
usb_bus = USB_BUS(object_resolve_type_unambiguous(TYPE_USB_BUS,
--
2.47.1