]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
usb-core: Allow the first packet of a pipelined ep to complete immediately
authorHans de Goede <hdegoede@redhat.com>
Mon, 3 Sep 2012 10:48:49 +0000 (12:48 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 12 Oct 2012 02:44:13 +0000 (21:44 -0500)
This can happen with usb-redir live-migration when the packet gets re-queued
after the migration and the original queuing from the migration source side
has already finished.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 9c1f67654ab611553bbfca54a1e0922728c25760)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/usb/core.c

index fe431d02d951d013cb93d7a0691a9547e3329de4..b9f1f7a8be1f30d4be937d538a3b89277a22fafc 100644 (file)
@@ -398,7 +398,7 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
              * When pipelining is enabled usb-devices must always return async,
              * otherwise packets can complete out of order!
              */
-            assert(!p->ep->pipeline);
+            assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue));
             if (ret != USB_RET_NAK) {
                 p->result = ret;
                 usb_packet_set_state(p, USB_PACKET_COMPLETE);