diff mbox

usb-redir: Fix usb errors when a combined input packet is pending on migrate

Message ID 1351699903-31933-2-git-send-email-hdegoede@redhat.com
State New
Headers show

Commit Message

Hans de Goede Oct. 31, 2012, 4:11 p.m. UTC
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 <hdegoede@redhat.com>
---
 hw/usb/redirect.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

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);
     }
 }