hw/ppc/spapr: simplify usb controller creation logic

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Marcel Apfelbaum 2015-01-06 15:29:16 +02:00 committed by Alexander Graf
parent b8cbc738de
commit 4ee9ced979

View File

@ -1528,9 +1528,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");