From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTx6b-0004C9-CC for qemu-devel@nongnu.org; Thu, 01 Nov 2012 11:54:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTx6Z-0008D2-0e for qemu-devel@nongnu.org; Thu, 01 Nov 2012 11:54:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTx6Y-0008At-O8 for qemu-devel@nongnu.org; Thu, 01 Nov 2012 11:54:50 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA1Fsoi8013662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Nov 2012 11:54:50 -0400 From: Gerd Hoffmann Date: Thu, 1 Nov 2012 16:54:42 +0100 Message-Id: <1351785284-15384-30-git-send-email-kraxel@redhat.com> In-Reply-To: <1351785284-15384-1-git-send-email-kraxel@redhat.com> References: <1351785284-15384-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 29/31] usb-redir: Use reject rather the disconnect on bad ep info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede So that the client gets a notification about us disconnecting the device. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/redirect.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index a3df757..5c2d185 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1353,7 +1353,8 @@ static void usbredir_ep_info(void *priv, case usb_redir_type_interrupt: if (dev->endpoint[i].interval == 0) { ERROR("Received 0 interval for isoc or irq endpoint\n"); - usbredir_device_disconnect(dev); + usbredir_reject_device(dev); + return; } /* Fall through */ case usb_redir_type_control: @@ -1363,7 +1364,7 @@ static void usbredir_ep_info(void *priv, break; default: ERROR("Received invalid endpoint type\n"); - usbredir_device_disconnect(dev); + usbredir_reject_device(dev); return; } } -- 1.7.1