From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>,
qemu-ppc@nongnu.org, kraxel@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH 7/7] PPC: Don't use legacy -usbdevice support for setting up board
Date: Wed, 4 Feb 2015 13:28:14 +0100 [thread overview]
Message-ID: <1423052894-13125-8-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1423052894-13125-1-git-send-email-armbru@redhat.com>
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>
---
hw/ppc/mac_newworld.c | 7 +++++--
hw/ppc/spapr.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index c377012..624b4ab 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -420,11 +420,14 @@ static void ppc_core99_init(MachineState *machine)
if (machine->usb) {
pci_create_simple(pci_bus, -1, "pci-ohci");
+
/* U3 needs to use USB for input because Linux doesn't support via-cuda
on PPC64 */
if (machine_arch == ARCH_MAC99_U3) {
- usbdevice_create("keyboard");
- usbdevice_create("mouse");
+ USBBus *usb_bus = usb_bus_find(-1);
+
+ usb_create_simple(usb_bus, "usb-kbd");
+ usb_create_simple(usb_bus, "usb-mouse");
}
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b560459..5112373 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1533,9 +1533,12 @@ static void ppc_spapr_init(MachineState *machine)
if (machine->usb) {
pci_create_simple(phb->bus, -1, "pci-ohci");
+
if (spapr->has_graphics) {
- usbdevice_create("keyboard");
- usbdevice_create("mouse");
+ USBBus *usb_bus = usb_bus_find(-1);
+
+ usb_create_simple(usb_bus, "usb-kbd");
+ usb_create_simple(usb_bus, "usb-mouse");
}
}
--
1.9.3
next prev parent reply other threads:[~2015-02-04 12:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 12:28 [Qemu-devel] [PATCH 0/7] usb: Improvements around device realization Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 1/7] usb: usb_create() can't fail, drop useless error handling Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 2/7] usb: Improve -usbdevice error reporting a bit Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 3/7] usb: Do not prefix error_setg() messages with "Error: " Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 4/7] usb: Suppress bogus error when automatic usb-hub creation fails Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 5/7] usb: Change usb_create_simple() to abort on failure Markus Armbruster
2015-02-04 12:28 ` [Qemu-devel] [PATCH 6/7] r2d: Don't use legacy -usbdevice support for setting up board Markus Armbruster
2015-02-04 12:28 ` Markus Armbruster [this message]
2015-02-04 12:40 ` [Qemu-devel] [PATCH 7/7] PPC: " Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423052894-13125-8-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).