OSDN Git Service

hw/ppc/spapr: simplify usb controller creation logic
authorMarcel Apfelbaum <marcel@redhat.com>
Tue, 6 Jan 2015 13:29:16 +0000 (15:29 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 8 Jan 2015 17:32:27 +0000 (17:32 +0000)
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-6-git-send-email-marcel@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/ppc/spapr.c

index 72c3102..53c4116 100644 (file)
@@ -1484,9 +1484,10 @@ static void ppc_spapr_init(MachineState *machine)
     /* Graphics */
     if (spapr_vga_init(phb->bus)) {
         spapr->has_graphics = true;
+        machine->usb |= defaults_enabled();
     }
 
-    if ((spapr->has_graphics && defaults_enabled()) || usb_enabled()) {
+    if (machine->usb) {
         pci_create_simple(phb->bus, -1, "pci-ohci");
         if (spapr->has_graphics) {
             usbdevice_create("keyboard");