From patchwork Fri Aug 17 15:27:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 178246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9CA622C009F for ; Sat, 18 Aug 2012 01:26:17 +1000 (EST) Received: from localhost ([::1]:39982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ORC-00039V-Pn for incoming@patchwork.ozlabs.org; Fri, 17 Aug 2012 11:26:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2OR5-00039F-Tw for qemu-devel@nongnu.org; Fri, 17 Aug 2012 11:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2OR4-0002Je-WE for qemu-devel@nongnu.org; Fri, 17 Aug 2012 11:26:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2OR4-0002JW-NS for qemu-devel@nongnu.org; Fri, 17 Aug 2012 11:26:06 -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 q7HFQ5Sn020559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Aug 2012 11:26:05 -0400 Received: from shalem.localdomain.com (vpn1-6-250.ams2.redhat.com [10.36.6.250]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7HFQ3Vf018455; Fri, 17 Aug 2012 11:26:03 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 17 Aug 2012 17:27:08 +0200 Message-Id: <1345217228-9734-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] usb-redir: Never return USB_RET_NAK for async handled packets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- hw/usb/redirect.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 1460515..9ba964e 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1055,11 +1055,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: