From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNi40-0005rj-Hc for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:38:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNi3y-0003v1-4n for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:38:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNi3x-0003uw-SO for qemu-devel@nongnu.org; Mon, 15 Oct 2012 06:38:22 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9FAcL9D020681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Oct 2012 06:38:21 -0400 From: Hans de Goede Date: Mon, 15 Oct 2012 12:38:25 +0200 Message-Id: <1350297511-25437-17-git-send-email-hdegoede@redhat.com> In-Reply-To: <1350297511-25437-1-git-send-email-hdegoede@redhat.com> References: <1350297511-25437-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 16/22] 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: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann 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 84b9705..99e25d4 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