From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR47n-0005C7-P9 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 12:48:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR47l-0007tV-PZ for qemu-devel@nongnu.org; Wed, 24 Oct 2012 12:48:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR47l-0007si-GT for qemu-devel@nongnu.org; Wed, 24 Oct 2012 12:48:09 -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 q9OGm5wP001857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Oct 2012 12:48:07 -0400 From: Hans de Goede Date: Wed, 24 Oct 2012 18:14:16 +0200 Message-Id: <1351095258-5579-21-git-send-email-hdegoede@redhat.com> In-Reply-To: <1351095258-5579-1-git-send-email-hdegoede@redhat.com> References: <1351095258-5579-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 20/22] usb-redir: Use reject rather the disconnect on bad ep info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org So that the client gets a notification about us disconnecting the device. Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index fe4eeea..b1fc7ef 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1378,7 +1378,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: @@ -1388,7 +1389,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.12.1