From 54c2a81b774cea91c7ff1aa530a73512cf8786a7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 12 Sep 2012 13:10:24 -0300 Subject: [RHEL6 qemu-kvm PATCH 05/14] usb-redir: Never return USB_RET_NAK for async handled packets RH-Author: Hans de Goede Message-id: <1347455431-11260-6-git-send-email-hdegoede@redhat.com> Patchwork-id: 41849 O-Subject: [RHEL-6.4 qemu-kvm PATCH 05/12] usb-redir: Never return USB_RET_NAK for async handled packets Bugzilla: RH-Acked-by: Alon Levy RH-Acked-by: Gerd Hoffmann RH-Acked-by: Christophe Fergeau Bugzilla-related: 805172 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 Signed-off-by: Gerd Hoffmann Upstream-commit: 181133404f520fab40a3ad40d935d91cf3cf546c --- usb-redir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Signed-off-by: Eduardo Habkost --- usb-redir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index bf1a2c9..c2ea51a 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -1046,11 +1046,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: -- 1.7.11.4