aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/ppc/mac_newworld.c3
-rw-r--r--hw/ppc/spapr.c2
-rw-r--r--include/sysemu/sysemu.h1
-rw-r--r--vl.c7
4 files changed, 10 insertions, 3 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index b60a832c0a..8ba9499695 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -417,7 +417,8 @@ static void ppc_core99_init(MachineState *machine)
dev = qdev_create(adb_bus, TYPE_ADB_MOUSE);
qdev_init_nofail(dev);
- if (usb_enabled(machine_arch == ARCH_MAC99_U3)) {
+ if ((machine_arch == ARCH_MAC99_U3 && defaults_enabled()) ||
+ usb_enabled(false)) {
pci_create_simple(pci_bus, -1, "pci-ohci");
/* U3 needs to use USB for input because Linux doesn't support via-cuda
on PPC64 */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 08401e0fde..d5de301939 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1486,7 +1486,7 @@ static void ppc_spapr_init(MachineState *machine)
spapr->has_graphics = true;
}
- if (usb_enabled(spapr->has_graphics)) {
+ if ((spapr->has_graphics && defaults_enabled()) || usb_enabled(false)) {
pci_create_simple(phb->bus, -1, "pci-ohci");
if (spapr->has_graphics) {
usbdevice_create("keyboard");
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 503e5a48a7..a31044c271 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -227,6 +227,7 @@ void qemu_boot_set(const char *boot_order, Error **errp);
QemuOpts *qemu_get_machine_opts(void);
+bool defaults_enabled(void);
bool usb_enabled(bool default_usb);
extern QemuOptsList qemu_legacy_drive_opts;
diff --git a/vl.c b/vl.c
index bea9656232..415535fb46 100644
--- a/vl.c
+++ b/vl.c
@@ -997,10 +997,15 @@ static int parse_name(QemuOpts *opts, void *opaque)
return 0;
}
+bool defaults_enabled(void)
+{
+ return has_defaults;
+}
+
bool usb_enabled(bool default_usb)
{
return qemu_opt_get_bool(qemu_get_machine_opts(), "usb",
- has_defaults && default_usb);
+ default_usb);
}
#ifndef _WIN32