From patchwork Wed Oct 31 12:47:14 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: 195861 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 8A4EA2C00B2 for ; Wed, 31 Oct 2012 23:46:08 +1100 (EST) Received: from localhost ([::1]:56347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXgM-0005dK-IJ for incoming@patchwork.ozlabs.org; Wed, 31 Oct 2012 08:46:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXfv-0005bg-T6 for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:45:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTXfu-0006BB-ML for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXfu-0006Ax-F0 for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:45:38 -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 q9VCjb7T031830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Oct 2012 08:45:37 -0400 Received: from shalem.localdomain.com (vpn1-6-145.ams2.redhat.com [10.36.6.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9VCjSSQ030662; Wed, 31 Oct 2012 08:45:36 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Wed, 31 Oct 2012 13:47:14 +0100 Message-Id: <1351687636-14253-7-git-send-email-hdegoede@redhat.com> In-Reply-To: <1351687636-14253-1-git-send-email-hdegoede@redhat.com> References: <1351687636-14253-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 6/8] usb-redir: Use reject rather the disconnect on bad ep info 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 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 ade5cc6..a3ce815 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1372,7 +1372,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: @@ -1382,7 +1383,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; } }