From patchwork Sat Mar 31 15:14:22 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: 149838 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 EFFBFB6FD0 for ; Sun, 1 Apr 2012 02:12:45 +1100 (EST) Received: from localhost ([::1]:39564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzyq-00052t-ES for incoming@patchwork.ozlabs.org; Sat, 31 Mar 2012 11:12:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzyY-0004wn-PN for qemu-devel@nongnu.org; Sat, 31 Mar 2012 11:12:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDzyW-0001Ep-3Z for qemu-devel@nongnu.org; Sat, 31 Mar 2012 11:12:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzyV-0001EQ-SB for qemu-devel@nongnu.org; Sat, 31 Mar 2012 11:12:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2VFCIb3005818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 31 Mar 2012 11:12:18 -0400 Received: from shalem.localdomain.com (vpn1-7-110.ams2.redhat.com [10.36.7.110]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2VFCFOY010172; Sat, 31 Mar 2012 11:12:17 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Sat, 31 Mar 2012 17:14:22 +0200 Message-Id: <1333206863-11425-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1333206863-11425-1-git-send-email-hdegoede@redhat.com> References: <1333206863-11425-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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 2/3] usb-redir: Reset device address and speed on disconnect 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 Without this disconnected devices look like the last redirected device in the monitor in "info usb". Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 9cea7c1..11d3b2b 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1134,6 +1134,8 @@ static void usbredir_device_disconnect(void *priv) } usb_ep_init(&dev->dev); dev->interface_info.interface_count = NO_INTERFACE_INFO; + dev->dev.addr = 0; + dev->dev.speed = 0; } static void usbredir_interface_info(void *priv,