]> git.proxmox.com Git - qemu.git/commitdiff
usb-redir: Never return USB_RET_NAK for async handled packets
authorHans de Goede <hdegoede@redhat.com>
Fri, 17 Aug 2012 15:27:08 +0000 (17:27 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 11 Sep 2012 05:42:59 +0000 (07:42 +0200)
USB_RET_NAK is not a valid response for async handled packets (and will
trigger an assert as such).

Also drop the warning when receiving a status of cancelled for packets not
cancelled by qemu itself, this can happen when a device gets unredirected
by the usbredir-host while transfers are pending.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/redirect.c

index 10b4fbb3a7bc23bdcfb8918561180ba3be1e7eeb..7f3719b19a05a333ad569ce01c59400a75b1f577 100644 (file)
@@ -1028,11 +1028,14 @@ static int usbredir_handle_status(USBRedirDevice *dev,
     case usb_redir_stall:
         return USB_RET_STALL;
     case usb_redir_cancelled:
-        WARNING("returning cancelled packet to HC?\n");
-        return USB_RET_NAK;
+        /*
+         * When the usbredir-host unredirects a device, it will report a status
+         * of cancelled for all pending packets, followed by a disconnect msg.
+         */
+        return USB_RET_IOERROR;
     case usb_redir_inval:
         WARNING("got invalid param error from usb-host?\n");
-        return USB_RET_NAK;
+        return USB_RET_IOERROR;
     case usb_redir_babble:
         return USB_RET_BABBLE;
     case usb_redir_ioerror: