* [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
@ 2015-03-14 5:33 Thomas Huth
2015-03-14 5:49 ` Thomas Huth
2015-03-17 12:05 ` Gerd Hoffmann
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Huth @ 2015-03-14 5:33 UTC (permalink / raw)
To: qemu-devel, Gerd Hoffmann; +Cc: qemu-trivial, Thomas Huth
Boards that do not include an USB controller should not provide
USB devices. However, when running "qemu-system-s390x -device help"
for example, there's still a usb-hub, usb-kbd, usb-mouse and
usb-tablet in the list of "supported" devices. Let's fix that
by compiling and linking the USB files only if it's really
necessary.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
---
default-configs/arm-softmmu.mak | 1 +
default-configs/usb.mak | 1 +
hw/usb/Makefile.objs | 8 ++++----
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 87d4e34..a767e4b 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -32,6 +32,7 @@ CONFIG_DS1338=y
CONFIG_PFLASH_CFI01=y
CONFIG_PFLASH_CFI02=y
CONFIG_MICRODRIVE=y
+CONFIG_USB=y
CONFIG_USB_MUSB=y
CONFIG_USB_EHCI_SYSBUS=y
CONFIG_PLATFORM_BUS=y
diff --git a/default-configs/usb.mak b/default-configs/usb.mak
index 73d8489..f4b8568 100644
--- a/default-configs/usb.mak
+++ b/default-configs/usb.mak
@@ -1,3 +1,4 @@
+CONFIG_USB=y
CONFIG_USB_TABLET_WACOM=y
CONFIG_USB_STORAGE_BOT=y
CONFIG_USB_STORAGE_UAS=y
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 0ccd477..c514831 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -1,6 +1,6 @@
# usb subsystem core
-common-obj-y += core.o combined-packet.o bus.o desc.o desc-msos.o
-common-obj-y += libhw.o
+common-obj-y += core.o bus.o libhw.o
+common-obj-$(CONFIG_USB) += combined-packet.o desc.o desc-msos.o
# usb host adapters
common-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
@@ -11,8 +11,8 @@ common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
common-obj-$(CONFIG_USB_MUSB) += hcd-musb.o
# emulated usb devices
-common-obj-y += dev-hub.o
-common-obj-y += dev-hid.o
+common-obj-$(CONFIG_USB) += dev-hub.o
+common-obj-$(CONFIG_USB) += dev-hid.o
common-obj-$(CONFIG_USB_TABLET_WACOM) += dev-wacom.o
common-obj-$(CONFIG_USB_STORAGE_BOT) += dev-storage.o
common-obj-$(CONFIG_USB_STORAGE_UAS) += dev-uas.o
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
2015-03-14 5:33 [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary Thomas Huth
@ 2015-03-14 5:49 ` Thomas Huth
2015-03-17 12:05 ` Gerd Hoffmann
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2015-03-14 5:49 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gerd Hoffmann
On Sat, 14 Mar 2015 06:33:35 +0100
Thomas Huth <thuth@linux.vnet.ibm.com> wrote:
> Boards that do not include an USB controller should not provide
> USB devices. However, when running "qemu-system-s390x -device help"
By the way, in case somebody wants to test the above example, and
wonders why there are also U/O/E/XHCI controllers in the list of
devices - the patch for removing them is currently on the way:
http://lists.nongnu.org/archive/html/qemu-devel/2015-03/msg02722.html
> for example, there's still a usb-hub, usb-kbd, usb-mouse and
> usb-tablet in the list of "supported" devices. Let's fix that
> by compiling and linking the USB files only if it's really
> necessary.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
2015-03-14 5:33 [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary Thomas Huth
2015-03-14 5:49 ` Thomas Huth
@ 2015-03-17 12:05 ` Gerd Hoffmann
2015-03-17 12:19 ` Gerd Hoffmann
1 sibling, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2015-03-17 12:05 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel
On Sa, 2015-03-14 at 06:33 +0100, Thomas Huth wrote:
> Boards that do not include an USB controller should not provide
> USB devices. However, when running "qemu-system-s390x -device help"
> for example, there's still a usb-hub, usb-kbd, usb-mouse and
> usb-tablet in the list of "supported" devices. Let's fix that
> by compiling and linking the USB files only if it's really
> necessary.
Added to usb queue.
thanks,
Gerd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
2015-03-17 12:05 ` Gerd Hoffmann
@ 2015-03-17 12:19 ` Gerd Hoffmann
2015-03-17 12:40 ` Thomas Huth
0 siblings, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2015-03-17 12:19 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel
On Di, 2015-03-17 at 13:05 +0100, Gerd Hoffmann wrote:
> On Sa, 2015-03-14 at 06:33 +0100, Thomas Huth wrote:
> > Boards that do not include an USB controller should not provide
> > USB devices. However, when running "qemu-system-s390x -device help"
> > for example, there's still a usb-hub, usb-kbd, usb-mouse and
> > usb-tablet in the list of "supported" devices. Let's fix that
> > by compiling and linking the USB files only if it's really
> > necessary.
>
> Added to usb queue.
Removed, fails to build.
Needs a complete rebuild due to the new CONFIG_USB option. Hardly
avoidable I guess. But even with that done I still get this:
LINK lm32-softmmu/qemu-system-lm32
../hw/usb/redirect.o: In function `usbredir_bulk_packet':
/home/kraxel/projects/qemu/hw/usb/redirect.c:1978: undefined reference
to `usb_combined_input_packet_complete'
../hw/usb/redirect.o: In function `usbredir_flush_ep_queue':
/home/kraxel/projects/qemu/hw/usb/redirect.c:951: undefined reference to
`usb_ep_combine_input_packets'
../hw/usb/redirect.o: In function `usbredir_cancel_packet':
/home/kraxel/projects/qemu/hw/usb/redirect.c:367: undefined reference to
`usb_combined_packet_cancel'
../hw/usb/host-libusb.o: In function `usb_host_cancel_packet':
/home/kraxel/projects/qemu/hw/usb/host-libusb.c:1014: undefined
reference to `usb_combined_packet_cancel'
../hw/usb/host-libusb.o: In function `usb_host_req_complete_data':
/home/kraxel/projects/qemu/hw/usb/host-libusb.c:396: undefined reference
to `usb_combined_input_packet_complete'
../hw/usb/host-libusb.o: In function `usb_host_flush_ep_queue':
/home/kraxel/projects/qemu/hw/usb/host-libusb.c:1358: undefined
reference to `usb_ep_combine_input_packets'
collect2: error: ld returned 1 exit status
cheers,
Gerd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
2015-03-17 12:19 ` Gerd Hoffmann
@ 2015-03-17 12:40 ` Thomas Huth
2015-03-17 13:02 ` Gerd Hoffmann
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2015-03-17 12:40 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-trivial, qemu-devel
On Tue, 17 Mar 2015 13:19:57 +0100
Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Di, 2015-03-17 at 13:05 +0100, Gerd Hoffmann wrote:
> > On Sa, 2015-03-14 at 06:33 +0100, Thomas Huth wrote:
> > > Boards that do not include an USB controller should not provide
> > > USB devices. However, when running "qemu-system-s390x -device help"
> > > for example, there's still a usb-hub, usb-kbd, usb-mouse and
> > > usb-tablet in the list of "supported" devices. Let's fix that
> > > by compiling and linking the USB files only if it's really
> > > necessary.
> >
> > Added to usb queue.
>
> Removed, fails to build.
>
> Needs a complete rebuild due to the new CONFIG_USB option. Hardly
> avoidable I guess. But even with that done I still get this:
>
> LINK lm32-softmmu/qemu-system-lm32
> ../hw/usb/redirect.o: In function `usbredir_bulk_packet':
> /home/kraxel/projects/qemu/hw/usb/redirect.c:1978: undefined reference
> to `usb_combined_input_packet_complete'
Oh, sorry, seems like I missed the "--enable-usb-redir" configure
option ... I'll have a look and rework my patch...
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary
2015-03-17 12:40 ` Thomas Huth
@ 2015-03-17 13:02 ` Gerd Hoffmann
0 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2015-03-17 13:02 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel
> Oh, sorry, seems like I missed the "--enable-usb-redir" configure
> option ... I'll have a look and rework my patch...
Oh, right, that can hide the failure.
Note there also is --enable-libusb
cheers,
Gerd
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-17 13:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-14 5:33 [Qemu-devel] [PATCH] hw/usb: Include USB files only if necessary Thomas Huth
2015-03-14 5:49 ` Thomas Huth
2015-03-17 12:05 ` Gerd Hoffmann
2015-03-17 12:19 ` Gerd Hoffmann
2015-03-17 12:40 ` Thomas Huth
2015-03-17 13:02 ` Gerd Hoffmann
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).