diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-07-28 15:14:56 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-07-29 11:18:55 +0200 |
commit | 557ae9763ad3669165c0db189118fac85bea706e (patch) | |
tree | 72e0f73ee7f0b94362791b2dd587b32849f717c4 /docs/system | |
parent | 78da86dce1780c7023624aa1dec8dd083e75db9c (diff) | |
download | qemu-557ae9763ad3669165c0db189118fac85bea706e.zip qemu-557ae9763ad3669165c0db189118fac85bea706e.tar.gz qemu-557ae9763ad3669165c0db189118fac85bea706e.tar.bz2 |
docs: Fold usb2.txt physical port addressing info into usb.rst
Fold the usb2.txt documentation about specifying which physical
port a USB device should use into usb.rst.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210728141457.14825-4-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'docs/system')
-rw-r--r-- | docs/system/devices/usb.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/system/devices/usb.rst b/docs/system/devices/usb.rst index 9f0e613..bab0cd3 100644 --- a/docs/system/devices/usb.rst +++ b/docs/system/devices/usb.rst @@ -199,6 +199,39 @@ option or the ``device_add`` monitor command. Available devices are: ``u2f-{emulated,passthru}`` Universal Second Factor device +Physical port addressing +^^^^^^^^^^^^^^^^^^^^^^^^ + +For all the above USB devices, by default QEMU will plug the device +into the next available port on the specified USB bus, or onto +some available USB bus if you didn't specify one explicitly. +If you need to, you can also specify the physical port where +the device will show up in the guest. This can be done using the +``port`` property. UHCI has two root ports (1,2). EHCI has six root +ports (1-6), and the emulated (1.1) USB hub has eight ports. + +Plugging a tablet into UHCI port 1 works like this:: + + -device usb-tablet,bus=usb-bus.0,port=1 + +Plugging a hub into UHCI port 2 works like this:: + + -device usb-hub,bus=usb-bus.0,port=2 + +Plugging a virtual USB stick into port 4 of the hub just plugged works +this way:: + + -device usb-storage,bus=usb-bus.0,port=2.4,drive=... + +In the monitor, the ``device_add` command also accepts a ``port`` +property specification. If you want to unplug devices too you should +specify some unique id which you can use to refer to the device. +You can then use ``device_del`` to unplug the device later. +For example:: + + (qemu) device_add usb-tablet,bus=usb-bus.0,port=1,id=my-tablet + (qemu) device_del my-tablet + Hotplugging USB storage ~~~~~~~~~~~~~~~~~~~~~~~ |