aboutsummaryrefslogtreecommitdiff
path: root/docs/system
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-07-28 15:14:57 +0100
committerGerd Hoffmann <kraxel@redhat.com>2021-07-29 11:18:55 +0200
commit30a20f2c5a9cf8f01ffcc918a7a5751dfe956524 (patch)
tree48b4e8b16cac7699c3f8de6f408a8939e8913695 /docs/system
parent557ae9763ad3669165c0db189118fac85bea706e (diff)
downloadqemu-30a20f2c5a9cf8f01ffcc918a7a5751dfe956524.zip
qemu-30a20f2c5a9cf8f01ffcc918a7a5751dfe956524.tar.gz
qemu-30a20f2c5a9cf8f01ffcc918a7a5751dfe956524.tar.bz2
docs: Fold usb2.txt passthrough information into usb.rst
Fold the usb2.txt information on device passthrough into usb.rst; since this is the last part of the .txt file we can delete it now. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210728141457.14825-5-peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'docs/system')
-rw-r--r--docs/system/devices/usb.rst49
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/system/devices/usb.rst b/docs/system/devices/usb.rst
index bab0cd3..afb7d6c 100644
--- a/docs/system/devices/usb.rst
+++ b/docs/system/devices/usb.rst
@@ -300,3 +300,52 @@ are not supported yet.
When relaunching QEMU, you may have to unplug and plug again the USB
device to make it work again (this is a bug).
+
+``usb-host`` properties for specifying the host device
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The example above uses the ``vendorid`` and ``productid`` to
+specify which host device to pass through, but this is not
+the only way to specify the host device. ``usb-host`` supports
+the following properties:
+
+``hostbus=<nr>``
+ Specifies the bus number the device must be attached to
+``hostaddr=<nr>``
+ Specifies the device address the device got assigned by the guest os
+``hostport=<str>``
+ Specifies the physical port the device is attached to
+``vendorid=<hexnr>``
+ Specifies the vendor ID of the device
+``productid=<hexnr>``
+ Specifies the product ID of the device.
+
+In theory you can combine all these properties as you like. In
+practice only a few combinations are useful:
+
+- ``vendorid`` and ``productid`` -- match for a specific device, pass it to
+ the guest when it shows up somewhere in the host.
+
+- ``hostbus`` and ``hostport`` -- match for a specific physical port in the
+ host, any device which is plugged in there gets passed to the
+ guest.
+
+- ``hostbus`` and ``hostaddr`` -- most useful for ad-hoc pass through as the
+ hostaddr isn't stable. The next time you plug the device into the host it
+ will get a new hostaddr.
+
+Note that on the host USB 1.1 devices are handled by UHCI/OHCI and USB
+2.0 by EHCI. That means different USB devices plugged into the very
+same physical port on the host may show up on different host buses
+depending on the speed. Supposing that devices plugged into a given
+physical port appear as bus 1 + port 1 for 2.0 devices and bus 3 + port 1
+for 1.1 devices, you can pass through any device plugged into that port
+and also assign it to the correct USB bus in QEMU like this:
+
+.. parsed-literal::
+
+ |qemu_system| -M pc [...] \\
+ -usb \\
+ -device usb-ehci,id=ehci \\
+ -device usb-host,bus=usb-bus.0,hostbus=3,hostport=1 \\
+ -device usb-host,bus=ehci.0,hostbus=1,hostport=1