Blame 0142-usb-redir-Never-return-USB_RET_NAK-for-async-handled.patch

5544c1
From 262c9bb1e59c2cd561dad1cf9d47c50f07af0e0f Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Fri, 17 Aug 2012 17:27:08 +0200
5544c1
Subject: [PATCH] usb-redir: Never return USB_RET_NAK for async handled
5544c1
 packets
c8dfc6
c8dfc6
USB_RET_NAK is not a valid response for async handled packets (and will
c8dfc6
trigger an assert as such).
c8dfc6
c8dfc6
Also drop the warning when receiving a status of cancelled for packets not
c8dfc6
cancelled by qemu itself, this can happen when a device gets unredirected
c8dfc6
by the usbredir-host while transfers are pending.
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5544c1
(cherry picked from commit 181133404f520fab40a3ad40d935d91cf3cf546c)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
c8dfc6
---
c8dfc6
 hw/usb/redirect.c | 9 ++++++---
c8dfc6
 1 file changed, 6 insertions(+), 3 deletions(-)
c8dfc6
c8dfc6
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
5544c1
index 10b4fbb..7f3719b 100644
c8dfc6
--- a/hw/usb/redirect.c
c8dfc6
+++ b/hw/usb/redirect.c
5544c1
@@ -1028,11 +1028,14 @@ static int usbredir_handle_status(USBRedirDevice *dev,
c8dfc6
     case usb_redir_stall:
c8dfc6
         return USB_RET_STALL;
c8dfc6
     case usb_redir_cancelled:
c8dfc6
-        WARNING("returning cancelled packet to HC?\n");
c8dfc6
-        return USB_RET_NAK;
c8dfc6
+        /*
c8dfc6
+         * When the usbredir-host unredirects a device, it will report a status
c8dfc6
+         * of cancelled for all pending packets, followed by a disconnect msg.
c8dfc6
+         */
c8dfc6
+        return USB_RET_IOERROR;
c8dfc6
     case usb_redir_inval:
c8dfc6
         WARNING("got invalid param error from usb-host?\n");
c8dfc6
-        return USB_RET_NAK;
c8dfc6
+        return USB_RET_IOERROR;
c8dfc6
     case usb_redir_babble:
c8dfc6
         return USB_RET_BABBLE;
c8dfc6
     case usb_redir_ioerror:
c8dfc6
-- 
5544c1
1.7.12.1
c8dfc6