Skip to contentSkip to conversation

package/qemu: enable usb passthrough on host variant

PATCH Superseded Angelo Compagnucci 4 participants 4 messages Oct 24, 2019 – Oct 25, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qemu: enable usb passthrough on host variant

Usb passthrough is a useful feature while using qemu for debugging purpose.

---
 package/qemu/qemu.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/qemu/qemu.mk +5 -0
index 1d3759a850..4cf1c60030 100644
@@ -264,6 +264,11 @@ else
 HOST_QEMU_OPTS += --disable-virtfs
 endif
 
+ifeq ($(BR2_PACKAGE_LIBUSB),y)
+HOST_QEMU_OPTS += --enable-libusb
+HOST_QEMU_DEPENDENCIES += host-libusb
+endif
+
 # Override CPP, as it expects to be able to call it like it'd
 # call the compiler.
 define HOST_QEMU_CONFIGURE_CMDS
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/qemu: enable usb passthrough on host variant

Quoted 13 lines · On Thu, 24 Oct 2019 22:28:20 +0200 Angelo Compagnucci…

Usb passthrough is a useful feature while using qemu for debugging purpose.

---
 package/qemu/qemu.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/qemu/qemu.mk +0 -0
index 1d3759a850..4cf1c60030 100644

package/qemu/qemu.mk else · line 267

Quoted 4 lines
package/qemu/qemu.mk +1 -0
@@ -264,6 +264,11 @@ else
 HOST_QEMU_OPTS += --disable-virtfs
 endif
 
+ifeq ($(BR2_PACKAGE_LIBUSB),y)

So, if the target libusb package is enabled...

package/qemu/qemu.mk else · line 269

Quoted 2 lines
package/qemu/qemu.mk +2 -0
+HOST_QEMU_OPTS += --enable-libusb
+HOST_QEMU_DEPENDENCIES += host-libusb

... you assume the user wants libusb support in host-qemu.

Sorry, but this is not good. Add an option in package/qemu/Config.in.host to enable USB passthrough, and use that in qemu.mk.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/qemu: enable usb passthrough on host variant

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

+ifeq ($(BR2_PACKAGE_LIBUSB),y)

So, if the target libusb package is enabled...

Quoted 8 lines

package/qemu/qemu.mk else · line 269

Quoted 2 lines
package/qemu/qemu.mk +2 -0
+HOST_QEMU_OPTS += --enable-libusb
+HOST_QEMU_DEPENDENCIES += host-libusb

... you assume the user wants libusb support in host-qemu.

Sorry, but this is not good. Add an option in package/qemu/Config.in.host to enable USB passthrough, and use that in qemu.mk.

And pass --disable-libusb (if such option exists) in the else clause.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 package/qemu: enable usb passthrough on host variant

Quoted 6 lines · Peter Korsgaard
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

+ifeq ($(BR2_PACKAGE_LIBUSB),y)

So, if the target libusb package is enabled...

Quoted 8 lines
Quoted 8 lines

package/qemu/qemu.mk else · line 269

Quoted 2 lines
package/qemu/qemu.mk +2 -0
+HOST_QEMU_OPTS += --enable-libusb
+HOST_QEMU_DEPENDENCIES += host-libusb

... you assume the user wants libusb support in host-qemu.

Sorry, but this is not good. Add an option in package/qemu/Config.in.host to enable USB passthrough, and use that in qemu.mk.

host-libusb takes 1 second to build (*). Is it really worth to make an option
for it?

Regards,
Arnout

(*) Yes, I'm exaggerating :-)

Quoted 3 lines

And pass --disable-libusb (if such option exists) in the else clause.