From patchwork Tue Nov 6 14:08:16 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: 197486 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 62FED2C0098 for ; Wed, 7 Nov 2012 01:37:39 +1100 (EST) Received: from localhost ([::1]:36223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVkHZ-0004j4-I1 for incoming@patchwork.ozlabs.org; Tue, 06 Nov 2012 09:37:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVkHS-0004iq-Rt for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:37:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVkHI-0005wJ-EP for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:37:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVkHI-0005w7-5l for qemu-devel@nongnu.org; Tue, 06 Nov 2012 09:37:20 -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 qA6EbJEA020443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Nov 2012 09:37:19 -0500 Received: from localhost.localdomain.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA6E7MeH012920; Tue, 6 Nov 2012 09:07:29 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Tue, 6 Nov 2012 15:08:16 +0100 Message-Id: <1352210901-1923-4-git-send-email-hdegoede@redhat.com> In-Reply-To: <1352210901-1923-1-git-send-email-hdegoede@redhat.com> References: <1352210901-1923-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 3/8] 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 have 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 b61bb6e..ad601d8 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); + } } }