package/qemu: Add option to enable USB passthrough support on host variant
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Fri, 25 Oct 2019 05:35:04 +0000 (07:35 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 25 Oct 2019 08:39:25 +0000 (10:39 +0200)
USB passthrough is a useful feature while using qemu for debugging purpose.

[Peter: reword commit message, pass --disable-libusb if not enabled]
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/qemu/Config.in.host
package/qemu/qemu.mk

index 9eceba5021c18f89bd50d80995eafa41a70932e7..43d55c88ce51be48d99ec5a4f433cb0c70de648d 100644 (file)
@@ -83,4 +83,9 @@ config BR2_PACKAGE_HOST_QEMU_VIRTFS
          Enables support for virtual filesystem in Qemu allowing
          shared filesystem between Qemu and its emulated target.
 
+config BR2_PACKAGE_HOST_QEMU_USB
+       bool "USB passthrough support"
+       help
+         Enables USB passthrough support from guest to host.
+
 endif
index cf2a570efaeb9775a6268c3f405e5d38da1644f3..5f97dab39f1867468028a27ea86cd67e0a95013f 100644 (file)
@@ -264,6 +264,13 @@ else
 HOST_QEMU_OPTS += --disable-virtfs
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_QEMU_USB),y)
+HOST_QEMU_OPTS += --enable-libusb
+HOST_QEMU_DEPENDENCIES += host-libusb
+else
+HOST_QEMU_OPTS += --disable-libusb
+endif
+
 # Override CPP, as it expects to be able to call it like it'd
 # call the compiler.
 define HOST_QEMU_CONFIGURE_CMDS