From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TL86M-0001Kx-V1 for qemu-devel@nongnu.org; Mon, 08 Oct 2012 03:50:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TL86K-00061B-QG for qemu-devel@nongnu.org; Mon, 08 Oct 2012 03:50:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TL86K-0005zi-Gl for qemu-devel@nongnu.org; Mon, 08 Oct 2012 03:50:08 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q987o7fh001502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Oct 2012 03:50:07 -0400 From: Hans de Goede Date: Mon, 8 Oct 2012 09:51:25 +0200 Message-Id: <1349682696-3046-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1349682696-3046-1-git-send-email-hdegoede@redhat.com> References: <1349682696-3046-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 01/12] usb-redir: When a packet contains data on a stall, ignore the stall List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org It is possbile for bulk packets to transfer some of the data and to then stall. ATM our usb core allows us to return either data, or an error, not both. For now return the data rather then the stall when this happens, counting on further packets to detect the stall. In the future we should fix the qemu usb core to handle packets completing with some data and an error. Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 022ba42..ae7393f 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1152,6 +1152,10 @@ static int usbredir_handle_status(USBRedirDevice *dev, case usb_redir_success: return actual_len; case usb_redir_stall: + if (actual_len > 0) { + WARNING("got both data and stall, returning data\n"); + return actual_len; + } return USB_RET_STALL; case usb_redir_cancelled: /* -- 1.7.12.1