usb: build usb-redir as module
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 24 Jun 2020 13:10:41 +0000 (15:10 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 7 Jul 2020 13:33:59 +0000 (15:33 +0200)
Drops libusbredirparser.so dependency from core qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200624131045.14512-7-kraxel@redhat.com

hw/usb/Makefile.objs
util/module.c

index 3c5b3d4fadd3a6ddd3aca72856c037e5ce5d8ba2..e342ff59fab07fb4bea1b532567b757e32cac426 100644 (file)
@@ -43,9 +43,12 @@ 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)
+ifeq ($(CONFIG_USB_REDIR),y)
+common-obj-m += redirect.mo
+redirect.mo-objs = redirect.o quirks.o
+redirect.mo-cflags = $(USB_REDIR_CFLAGS)
+redirect.mo-libs = $(USB_REDIR_LIBS)
+endif
 endif
 
 # usb pass-through
index 89da9a3cce05743f1dcd76a43ca7487b8a48a656..e3226165e91c66596389bcbbb877bdf4e605b6b7 100644 (file)
@@ -263,6 +263,7 @@ static struct {
 } const qom_modules[] = {
     { "ccid-card-passthru",    "hw-", "usb-smartcard"         },
     { "ccid-card-emulated",    "hw-", "usb-smartcard"         },
+    { "usb-redir",             "hw-", "usb-redirect"          },
 };
 
 static bool module_loaded_qom_all;