From patchwork Thu Nov 15 13:14:59 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: 199274 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 ECF322C03A8 for ; Fri, 16 Nov 2012 00:13:56 +1100 (EST) Received: from localhost ([::1]:45423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYzGU-0007go-VW for incoming@patchwork.ozlabs.org; Thu, 15 Nov 2012 08:13:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYzFl-0005tT-Nq for qemu-devel@nongnu.org; Thu, 15 Nov 2012 08:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYzFi-0002RE-LX for qemu-devel@nongnu.org; Thu, 15 Nov 2012 08:13:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYzFi-0002R7-EA for qemu-devel@nongnu.org; Thu, 15 Nov 2012 08:13:06 -0500 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 qAFDD5Hd029338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 Nov 2012 08:13:06 -0500 Received: from shalem.localdomain.com (vpn1-5-221.ams2.redhat.com [10.36.5.221]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAFDD2Df031927; Thu, 15 Nov 2012 08:13:04 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Thu, 15 Nov 2012 14:14:59 +0100 Message-Id: <1352985300-4712-3-git-send-email-hdegoede@redhat.com> In-Reply-To: <1352985300-4712-1-git-send-email-hdegoede@redhat.com> References: <1352985300-4712-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: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/3] usb-redir: Only add actually in flight packets to the in flight queue 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 Packets which are queued up, but not yet handed over to the device, are *not* in flight. Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index d9236c5..4cd32d6 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -352,7 +352,9 @@ static void usbredir_fill_already_in_flight_from_ep(USBRedirDevice *dev, if (p->combined && p != p->combined->first) { continue; } - packet_id_queue_add(&dev->already_in_flight, p->id); + if (p->state == USB_PACKET_ASYNC) { + packet_id_queue_add(&dev->already_in_flight, p->id); + } } }