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)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 11 Sep 2012 05:42:59 +0000 (07:42 +0200)
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>
hw/usb/core.c

index fe431d0..b9f1f7a 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);