From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153717831487640.54977095490847; Mon, 17 Sep 2018 02:58:34 -0700 (PDT) Received: from localhost ([::1]:34748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qIb-00037C-4K for importer@patchew.org; Mon, 17 Sep 2018 05:58:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGY-0001O4-24 for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGW-0005W7-Kh for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59348) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGW-0005Vg-EJ for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C761231500B2 for ; Mon, 17 Sep 2018 09:56:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8558917AC2; Mon, 17 Sep 2018 09:56:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 31F9E99AEF; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:13 +0200 Message-Id: <20180917095618.23930-2-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 17 Sep 2018 09:56:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/6] usb-mtp: fix error conditions for write operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bandan , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Bandan Return STORE_FULL if we can't write all the bytes but return incomplete transfer if data received is less then what was specified in the metadata. Also, use d->offset as the file size which is valid for all file sizes. Signed-off-by: Bandan Message-id: 20180907220851.9658-2-bsd@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/dev-mtp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 3fdc4b0da1..15edf3bb82 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1665,13 +1665,14 @@ static void usb_mtp_write_data(MTPState *s) goto success; } =20 - rc =3D write_retry(d->fd, d->data, s->dataset.size); - if (!rc) { + rc =3D write_retry(d->fd, d->data, d->offset); + if (rc !=3D d->offset) { usb_mtp_queue_result(s, RES_STORE_FULL, d->trans, 0, 0, 0, 0); goto done; } - if (rc !=3D s->dataset.size) { + /* Only for < 4G file sizes */ + if (s->dataset.size !=3D 0xFFFFFFFF && rc !=3D s->dataset.size) { usb_mtp_queue_result(s, RES_INCOMPLETE_TRANSFER, d->trans, 0, 0, 0, 0); goto done; --=20 2.9.3 From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537178490377539.763512236356; Mon, 17 Sep 2018 03:01:30 -0700 (PDT) Received: from localhost ([::1]:34766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qLR-0005SI-1d for importer@patchew.org; Mon, 17 Sep 2018 06:01:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGb-0001SQ-HF for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGa-0005fh-An for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44758) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGa-0005ba-3f for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:28 -0400 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 799093086271 for ; Mon, 17 Sep 2018 09:56:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 865CC8AD7F; Mon, 17 Sep 2018 09:56:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4012299AF8; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:14 +0200 Message-Id: <20180917095618.23930-3-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 17 Sep 2018 09:56:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/6] doc: replace x-root with rootdir for usb-mtp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bandan , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Bandan Signed-off-by: Bandan Message-id: 20180907220851.9658-3-bsd@redhat.com Signed-off-by: Gerd Hoffmann --- qemu-doc.texi | 2 +- scripts/device-crash-test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 7bd449f398..f7ad1dfe4b 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -943,7 +943,7 @@ for details Bulk-only transport storage device, see @url{https://git.qemu.org/?p=3Dqemu.git;a=3Dblob_plain;f=3Ddocs/usb-storag= e.txt,usb-storage.txt} for details here, too -@item usb-mtp,x-root=3D@var{dir} +@item usb-mtp,rootdir=3D@var{dir} Media transfer protocol device, using @var{dir} as root of the file tree that is presented to the guest. @item usb-host,hostbus=3D@var{bus},hostaddr=3D@var{addr} diff --git a/scripts/device-crash-test b/scripts/device-crash-test index e6c233e9bf..7045594bd4 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -125,7 +125,7 @@ ERROR_WHITELIST =3D [ {'device':'tpm-tis', 'expected':True}, # tpm_tis: back= end driver with id (null) could not be found {'device':'unimplemented-device', 'expected':True}, # property 'siz= e' not specified or zero {'device':'usb-braille', 'expected':True}, # Property char= dev is required - {'device':'usb-mtp', 'expected':True}, # x-root proper= ty must be configured + {'device':'usb-mtp', 'expected':True}, # rootdir prope= rty must be configured {'device':'usb-redir', 'expected':True}, # Parameter 'ch= ardev' is missing {'device':'usb-serial', 'expected':True}, # Property char= dev is required {'device':'usb-storage', 'expected':True}, # drive propert= y not set --=20 2.9.3 From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537178316985681.5819156251512; Mon, 17 Sep 2018 02:58:36 -0700 (PDT) Received: from localhost ([::1]:34749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qId-00038h-U6 for importer@patchew.org; Mon, 17 Sep 2018 05:58:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGb-0001SP-HD for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGa-0005h8-IV for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37512) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGa-0005be-Av for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF68230821F3 for ; Mon, 17 Sep 2018 09:56:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BBA0784A0; Mon, 17 Sep 2018 09:56:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4A75B9B2F2; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:15 +0200 Message-Id: <20180917095618.23930-4-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 17 Sep 2018 09:56:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/6] usb-mtp: reset ObjectInfo dataset size on cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bandan Das , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Bandan Das Stale values in this field may result in qemu expecting more data on the next operation Signed-off-by: Bandan Das Message-id: 20180907220851.9658-4-bsd@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/dev-mtp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 15edf3bb82..00a3691bae 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1568,6 +1568,7 @@ static void usb_mtp_handle_control(USBDevice *dev, US= BPacket *p, if (s->write_pending) { g_free(s->dataset.filename); s->write_pending =3D false; + s->dataset.size =3D 0; } usb_mtp_data_free(s->data_out); s->data_out =3D NULL; @@ -1693,6 +1694,7 @@ done: } free: g_free(s->dataset.filename); + s->dataset.size =3D 0; g_free(path); s->write_pending =3D false; } --=20 2.9.3 From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537178390422568.2469738275113; Mon, 17 Sep 2018 02:59:50 -0700 (PDT) Received: from localhost ([::1]:34750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qJp-00046A-6U for importer@patchew.org; Mon, 17 Sep 2018 05:59:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGY-0001OE-2h for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGW-0005WP-Oq for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41439) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGW-0005Vm-Hf for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:24 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id DE5B0FEAF for ; Mon, 17 Sep 2018 09:56:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B52A4B6; Mon, 17 Sep 2018 09:56:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 52C6B9B2F4; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:16 +0200 Message-Id: <20180917095618.23930-5-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Sep 2018 09:56:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/6] usb-hub: clear suspend on detach X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Message-id: 20180912114012.6034-1-kraxel@redhat.com --- hw/usb/dev-hub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 5d9743ef93..dc368179d1 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -191,6 +191,10 @@ static void usb_hub_detach(USBPort *port1) port->wPortStatus &=3D ~PORT_STAT_ENABLE; port->wPortChange |=3D PORT_STAT_C_ENABLE; } + if (port->wPortStatus & PORT_STAT_SUSPEND) { + port->wPortStatus &=3D ~PORT_STAT_SUSPEND; + port->wPortChange |=3D PORT_STAT_C_SUSPEND; + } usb_wakeup(s->intr, 0); } =20 --=20 2.9.3 From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537178490707818.1645576428433; Mon, 17 Sep 2018 03:01:30 -0700 (PDT) Received: from localhost ([::1]:34765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qLR-0005SE-80 for importer@patchew.org; Mon, 17 Sep 2018 06:01:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGY-0001O6-2A for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGW-0005WX-S6 for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16845) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGW-0005Vo-Lh for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:24 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id E3199155C6 for ; Mon, 17 Sep 2018 09:56:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD3A46147F; Mon, 17 Sep 2018 09:56:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5C87C9B2F5; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:17 +0200 Message-Id: <20180917095618.23930-6-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 17 Sep 2018 09:56:23 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/6] usb: add config options for hub and hid devices (kbd, mouse, tablet). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Message-id: 20180830045324.21584-1-kraxel@redhat.com --- default-configs/usb.mak | 2 ++ hw/usb/Makefile.objs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/default-configs/usb.mak b/default-configs/usb.mak index e42cfeabbe..3ee117dbf6 100644 --- a/default-configs/usb.mak +++ b/default-configs/usb.mak @@ -1,4 +1,6 @@ CONFIG_USB=3Dy +CONFIG_USB_HUB=3Dy +CONFIG_USB_HID=3Dy CONFIG_USB_TABLET_WACOM=3Dy CONFIG_USB_STORAGE_BOT=3Dy CONFIG_USB_STORAGE_UAS=3Dy diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 41be700812..c8802aaefd 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -15,8 +15,8 @@ obj-$(CONFIG_TUSB6010) +=3D tusb6010.o obj-$(CONFIG_IMX) +=3D chipidea.o =20 # emulated usb devices -common-obj-$(CONFIG_USB) +=3D dev-hub.o -common-obj-$(CONFIG_USB) +=3D dev-hid.o +common-obj-$(CONFIG_USB_HUB) +=3D dev-hub.o +common-obj-$(CONFIG_USB_HID) +=3D dev-hid.o common-obj-$(CONFIG_USB_TABLET_WACOM) +=3D dev-wacom.o common-obj-$(CONFIG_USB_STORAGE_BOT) +=3D dev-storage.o common-obj-$(CONFIG_USB_STORAGE_UAS) +=3D dev-uas.o --=20 2.9.3 From nobody Wed Nov 5 18:21:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537178493026892.9024088202159; Mon, 17 Sep 2018 03:01:33 -0700 (PDT) Received: from localhost ([::1]:34767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qLT-0005Tv-2v for importer@patchew.org; Mon, 17 Sep 2018 06:01:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1qGb-0001SR-LI for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1qGa-0005hP-NB for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52776) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g1qGa-0005cE-Et for qemu-devel@nongnu.org; Mon, 17 Sep 2018 05:56:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB5C237E79 for ; Mon, 17 Sep 2018 09:56:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-56.phx2.redhat.com [10.3.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFBD3582BA; Mon, 17 Sep 2018 09:56:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 661D99B2FB; Mon, 17 Sep 2018 11:56:18 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 11:56:18 +0200 Message-Id: <20180917095618.23930-7-kraxel@redhat.com> In-Reply-To: <20180917095618.23930-1-kraxel@redhat.com> References: <20180917095618.23930-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 17 Sep 2018 09:56:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/6] usb: assign unique serial numbers to hid devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Windows guests have trouble dealing with usb devices having identical serial numbers. So, assign unique serial numbers to usb hid devices. All other usb devices have this already. Signed-off-by: Gerd Hoffmann Reviewed-by: Dr. David Alan Gilbert Message-id: 20180914104835.26019-1-kraxel@redhat.com --- include/hw/compat.h | 14 +++++++++++++- hw/usb/dev-hid.c | 24 +++++++++++++----------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/include/hw/compat.h b/include/hw/compat.h index 6f4d5fc647..c059459394 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -2,7 +2,19 @@ #define HW_COMPAT_H =20 #define HW_COMPAT_3_0 \ - /* empty */ + {\ + .driver =3D "usb-kbd",\ + .property =3D "serial",\ + .value =3D "42",\ + },{\ + .driver =3D "usb-mouse",\ + .property =3D "serial",\ + .value =3D "42",\ + },{\ + .driver =3D "usb-tablet",\ + .property =3D "serial",\ + .value =3D "42",\ + }, =20 #define HW_COMPAT_2_12 \ {\ diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 62d18290dc..7ad6fb33a9 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -61,7 +61,9 @@ enum { STR_PRODUCT_MOUSE, STR_PRODUCT_TABLET, STR_PRODUCT_KEYBOARD, - STR_SERIALNUMBER, + STR_SERIAL_MOUSE, + STR_SERIAL_TABLET, + STR_SERIAL_KEYBOARD, STR_CONFIG_MOUSE, STR_CONFIG_TABLET, STR_CONFIG_KEYBOARD, @@ -72,7 +74,9 @@ static const USBDescStrings desc_strings =3D { [STR_PRODUCT_MOUSE] =3D "QEMU USB Mouse", [STR_PRODUCT_TABLET] =3D "QEMU USB Tablet", [STR_PRODUCT_KEYBOARD] =3D "QEMU USB Keyboard", - [STR_SERIALNUMBER] =3D "42", /* =3D=3D remote wakeup works */ + [STR_SERIAL_MOUSE] =3D "89126", + [STR_SERIAL_TABLET] =3D "28754", + [STR_SERIAL_KEYBOARD] =3D "68284", [STR_CONFIG_MOUSE] =3D "HID Mouse", [STR_CONFIG_TABLET] =3D "HID Tablet", [STR_CONFIG_KEYBOARD] =3D "HID Keyboard", @@ -375,7 +379,7 @@ static const USBDesc desc_mouse =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_MOUSE, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_MOUSE, }, .full =3D &desc_device_mouse, .str =3D desc_strings, @@ -389,7 +393,7 @@ static const USBDesc desc_mouse2 =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_MOUSE, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_MOUSE, }, .full =3D &desc_device_mouse, .high =3D &desc_device_mouse2, @@ -404,7 +408,7 @@ static const USBDesc desc_tablet =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_TABLET, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_TABLET, }, .full =3D &desc_device_tablet, .str =3D desc_strings, @@ -418,7 +422,7 @@ static const USBDesc desc_tablet2 =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_TABLET, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_TABLET, }, .full =3D &desc_device_tablet, .high =3D &desc_device_tablet2, @@ -433,7 +437,7 @@ static const USBDesc desc_keyboard =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_KEYBOARD, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_TABLET, }, .full =3D &desc_device_keyboard, .str =3D desc_strings, @@ -447,7 +451,7 @@ static const USBDesc desc_keyboard2 =3D { .bcdDevice =3D 0, .iManufacturer =3D STR_MANUFACTURER, .iProduct =3D STR_PRODUCT_KEYBOARD, - .iSerialNumber =3D STR_SERIALNUMBER, + .iSerialNumber =3D STR_SERIAL_TABLET, }, .full =3D &desc_device_keyboard, .high =3D &desc_device_keyboard2, @@ -718,9 +722,7 @@ static void usb_hid_initfn(USBDevice *dev, int kind, return; } =20 - if (dev->serial) { - usb_desc_set_string(dev, STR_SERIALNUMBER, dev->serial); - } + usb_desc_create_serial(dev); usb_desc_init(dev); us->intr =3D usb_ep_get(dev, USB_TOKEN_IN, 1); hid_init(&us->hid, kind, usb_hid_changed); --=20 2.9.3