PPC: Don't use legacy -usbdevice support for setting up board

It's tempting, because usbdevice_create() is so simple to use.  But
there's a lot of unwanted complexity behind the simple interface.
Switch to usb_create_simple().

Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Markus Armbruster 2015-02-04 13:28:14 +01:00 committed by Gerd Hoffmann
parent 456dcd8ab4
commit c86580b889
2 changed files with 10 additions and 4 deletions

View File

@ -420,11 +420,14 @@ static void ppc_core99_init(MachineState *machine)
if (machine->usb) { if (machine->usb) {
pci_create_simple(pci_bus, -1, "pci-ohci"); pci_create_simple(pci_bus, -1, "pci-ohci");
/* U3 needs to use USB for input because Linux doesn't support via-cuda /* U3 needs to use USB for input because Linux doesn't support via-cuda
on PPC64 */ on PPC64 */
if (machine_arch == ARCH_MAC99_U3) { if (machine_arch == ARCH_MAC99_U3) {
usbdevice_create("keyboard"); USBBus *usb_bus = usb_bus_find(-1);
usbdevice_create("mouse");
usb_create_simple(usb_bus, "usb-kbd");
usb_create_simple(usb_bus, "usb-mouse");
} }
} }

View File

@ -1533,9 +1533,12 @@ static void ppc_spapr_init(MachineState *machine)
if (machine->usb) { if (machine->usb) {
pci_create_simple(phb->bus, -1, "pci-ohci"); pci_create_simple(phb->bus, -1, "pci-ohci");
if (spapr->has_graphics) { if (spapr->has_graphics) {
usbdevice_create("keyboard"); USBBus *usb_bus = usb_bus_find(-1);
usbdevice_create("mouse");
usb_create_simple(usb_bus, "usb-kbd");
usb_create_simple(usb_bus, "usb-mouse");
} }
} }