From patchwork Thu Jul 29 12:50:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 488719 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp2134050jas; Thu, 29 Jul 2021 05:53:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyn0wlu3nByiP+q+zjqOOuHDL+3xwq/uzOZ3LnrKUdjUwbLmGRn2AmP5VlDgHKSJaEyqO5T X-Received: by 2002:ab0:209:: with SMTP id 9mr3998041uas.135.1627563204194; Thu, 29 Jul 2021 05:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627563204; cv=none; d=google.com; s=arc-20160816; b=Li1WxDyK6eXSdi2oy4c/5ScvMWd4Tcc4e6oIx2z04idMAo4eMOHrFmFYH/vhpIJVL1 LlVjJdqmJpBr/DIkaMFeuvwg2ilk1vc1yME7L4Wb8CPeWydd88aL+fCrA3Mq2RW27XIY tDAVYosf8bwJqu8pnxZfXLb+5y84YIWBioYfIW7y84LEKeE8yVK1qa8R7oI66vlR3zpe kFKqr/TFmJZjoBdA0w3brcOiwEveuhitHnu8S4Igawv9sgpy07cKonWflQkKl/fLQUNJ NZpyqiT6B874cdl1KfBur3vIwh+tV2FUhpHow/bXp9Qkw+79Ua9Swd3o419sXKEodsms mdWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=P2G7uEUlC1wBa+DO0orPvkKIN2JlSfV8MvgpAs3qKe0=; b=UKZdK1SoesN5iRTb9f1yYWLCyvPyEAAl2VDVy/4pK59RFmeqQM5lUbWp+/lEO+Jwce M0uj6wkpO1+OOD7QLqgSk+9RkJU3F5cLHOsJgEveKlmQ3KUkha8AWc1pU7yJZEsCWVCr PtkDSgHF4lIOf+iu5j+Suo9qQrukZKfY8XPFXlN1RJE+MBSjxYMKkCJPuz+2DacOa56p 6cpqUxzChVSZeJJAVU6AimaFzTW+jLVReOcutJX3yZkTeLcy3vJaxqZzLtBqNeuCARmz KHv5ffQSD4uU2JItnT3qrOJeSTMox+JmUF/+kL6E933YLEx9gwZG+ceq4MCtMELu3zSL AXoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=SKd9kiR3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o5si1371605uae.91.2021.07.29.05.53.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 05:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=SKd9kiR3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:46046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m95XP-000795-H0 for patch@linaro.org; Thu, 29 Jul 2021 08:53:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95VZ-00053g-4z for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:51:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m95VX-0001v2-B9 for qemu-devel@nongnu.org; Thu, 29 Jul 2021 08:51:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627563086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P2G7uEUlC1wBa+DO0orPvkKIN2JlSfV8MvgpAs3qKe0=; b=SKd9kiR3nxMgJbCvtccUVaHs1WQLAoArzixN3dCJqfKL+16/sDlo3LybOMqW9eQDronIBF IQx8BjgQ4/PLE6AL4FJ7eatXFpslKNCu71IYge/n4Ojdk4NpBh3B7jr8mxsmEPFbarxzLc 7D9nH3FH2IUcRBnogwtsFzXVpdGpijE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-331-JLKiq9QLOJyyupNXBnroFw-1; Thu, 29 Jul 2021 08:51:23 -0400 X-MC-Unique: JLKiq9QLOJyyupNXBnroFw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6398E107ACF5; Thu, 29 Jul 2021 12:51:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-106.ams2.redhat.com [10.36.114.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B56D5C1D1; Thu, 29 Jul 2021 12:51:12 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D2B661800981; Thu, 29 Jul 2021 14:50:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 6/7] docs: Fold usb2.txt physical port addressing info into usb.rst Date: Thu, 29 Jul 2021 14:50:43 +0200 Message-Id: <20210729125044.3531457-7-kraxel@redhat.com> In-Reply-To: <20210729125044.3531457-1-kraxel@redhat.com> References: <20210729125044.3531457-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.717, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , Gerd Hoffmann , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Fold the usb2.txt documentation about specifying which physical port a USB device should use into usb.rst. Signed-off-by: Peter Maydell Message-Id: <20210728141457.14825-4-peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann --- docs/usb2.txt | 32 -------------------------------- docs/system/devices/usb.rst | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 32 deletions(-) -- 2.31.1 diff --git a/docs/usb2.txt b/docs/usb2.txt index adf4ba3f2a0c..6a88d5314f9c 100644 --- a/docs/usb2.txt +++ b/docs/usb2.txt @@ -6,38 +6,6 @@ Recently the USB pass through driver (also known as usb-host) and the QEMU USB subsystem gained a few capabilities which are available only via qdev properties, i,e. when using '-device'. - -physical port addressing ------------------------- - -First you can (for all USB devices) 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), 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=... - -You can do basically the same in the monitor using the device_add -command. If you want to unplug devices too you should specify some -unique id which you can use to refer to the device ... - - (qemu) device_add usb-tablet,bus=usb-bus.0,port=1,id=my-tablet - (qemu) device_del my-tablet - -... when unplugging it with device_del. - - USB pass through hints ---------------------- diff --git a/docs/system/devices/usb.rst b/docs/system/devices/usb.rst index 9f0e613dcc7c..bab0cd3fdfd1 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 ~~~~~~~~~~~~~~~~~~~~~~~