diff options
author | Marcel Apfelbaum <marcel@redhat.com> | 2015-01-06 15:29:12 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-01-08 17:32:27 +0000 |
commit | f8b6f8edac926bb979bd2b1d21d896c219b522c2 (patch) | |
tree | 4bb6a1eecf163490c413feeacbeb2816b8774e8b /hw | |
parent | ab0302ee764fd702465aef6d88612cdff4302809 (diff) | |
download | qemu-f8b6f8edac926bb979bd2b1d21d896c219b522c2.zip qemu-f8b6f8edac926bb979bd2b1d21d896c219b522c2.tar.gz qemu-f8b6f8edac926bb979bd2b1d21d896c219b522c2.tar.bz2 |
hw/ppc: modified the condition for usb controllers to be created for some ppc machines
Some ppc machines create a default usb controller based on a 'machine condition'.
Until now the logic was: create the usb controller if:
- the usb option was supplied in cli and value is true or
- the usb option was absent and both set_defaults and the machine
condition were true.
Modified the logic to:
Create the usb controller if:
- the machine condition is true and defaults are enabled or
- the usb option is supplied and true.
The main for this is to simplify the usb_enabled method.
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-id: 1420550957-22337-2-git-send-email-marcel@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/mac_newworld.c | 3 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index b60a832..8ba9499 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 08401e0..d5de301 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"); |