hw/usb/redirect: Do not link 'usb-redir' device when USB not enabled
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 31 Dec 2019 18:32:03 +0000 (19:32 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jan 2020 11:08:39 +0000 (12:08 +0100)
The 'usb-redir' device requires the USB core code to work. Do not
link it when there is no USB support. This fixes:

  $ qemu-system-tricore -M tricore_testboard -device usb-redir
  qemu-system-tricore: -device usb-redir: No 'usb-bus' bus found for device 'usb-redir'

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191231183216.6781-2-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/usb/Makefile.objs

index 0ab20f9d731214bba9c94971d4fa28684ea9ed87..0052d49ce1dd84b3d175a3a6e0ff795c87cbc592 100644 (file)
@@ -39,9 +39,11 @@ common-obj-$(CONFIG_USB_STORAGE_MTP)  += dev-mtp.o
 endif
 
 # usb redirection
+ifeq ($(CONFIG_USB),y)
 common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o
 redirect.o-cflags = $(USB_REDIR_CFLAGS)
 redirect.o-libs = $(USB_REDIR_LIBS)
+endif
 
 # usb pass-through
 ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy)