[01/14] hw/usb/redirect: Do not link 'usb-redir' device when USB not enabled
diff mbox series

Message ID 20191231183216.6781-2-philmd@redhat.com
State New
Headers show
Series
  • hw: Fix various --without-default-devices issues
Related show

Commit Message

Philippe Mathieu-Daudé Dec. 31, 2019, 6:32 p.m. UTC
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>
---
 hw/usb/Makefile.objs | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Huth Jan. 7, 2020, 12:24 p.m. UTC | #1
On 31/12/2019 19.32, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>  hw/usb/Makefile.objs | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
> index 0ab20f9d73..0052d49ce1 100644
> --- a/hw/usb/Makefile.objs
> +++ b/hw/usb/Makefile.objs
> @@ -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)
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

Patch
diff mbox series

diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 0ab20f9d73..0052d49ce1 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -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)