From patchwork Wed Oct 31 16:11:43 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: 195940 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 A1AA82C0147 for ; Thu, 1 Nov 2012 03:55:07 +1100 (EST) Received: from localhost ([::1]:36148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTbZJ-0003ZZ-Oo for incoming@patchwork.ozlabs.org; Wed, 31 Oct 2012 12:55:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTbZ7-0003Ym-NH for qemu-devel@nongnu.org; Wed, 31 Oct 2012 12:54:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTbZ6-0004EH-SW for qemu-devel@nongnu.org; Wed, 31 Oct 2012 12:54:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTbZ6-0004AI-KQ for qemu-devel@nongnu.org; Wed, 31 Oct 2012 12:54:52 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9VGsVpg015963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Oct 2012 12:54:49 -0400 Received: from shalem.localdomain.com (vpn1-4-32.ams2.redhat.com [10.36.4.32]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9VG9t4D011056; Wed, 31 Oct 2012 12:09:56 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Wed, 31 Oct 2012 17:11:43 +0100 Message-Id: <1351699903-31933-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1351699903-31933-1-git-send-email-hdegoede@redhat.com> References: <1351699903-31933-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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] usb-redir: Fix usb errors when a combined input packet is pending on migrate 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 the destination usb-redir device will be confused about in-flight packets after the migration, and eventually an usb transfer in the guest will timeout because of this. Signed-off-by: Hans de Goede --- hw/usb/redirect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index d93f22f..e316963 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -348,6 +348,10 @@ static void usbredir_fill_already_in_flight_from_ep(USBRedirDevice *dev, static USBPacket *p; QTAILQ_FOREACH(p, &ep->queue, queue) { + /* Skip combined packets, except for the first */ + if (p->combined && p != p->combined->first) { + continue; + } packet_id_queue_add(&dev->already_in_flight, p->id); } }