Hi, ive been using a JetFlash usb-storage device with kvm-qemu and
Windows XP as a guest. I have seen that before setting up the device
properly, Windows resets it 5 or 6 times, which makes the process
awfully slow. Diving into the code I found that qemu's emulation was
not giving the host the right status when there was a "babble" or
"stall" situation. After applying the following patch the setup time
was cut up by a ~200%.

Cheers,
Daniel

--- old/kvm-75/qemu/usb-linux.c 2008-09-07 18:38:33.000000000 +0200
+++ new/kvm-75/qemu/usb-linux.c 2008-09-18 15:13:47.000000000 +0200
@@ -208,9 +208,13 @@
                 p->len = aurb->urb.actual_length;
                 break;

+            case -EOVERFLOW:
+               p->len = USB_RET_BABBLE;
+               break;
             case -EPIPE:
                 set_halt(s, p->devep);
-                /* fall through */
+                p->len = USB_RET_STALL;
+               break;
             default:
                 p->len = USB_RET_NAK;
                 break;

Attachment: usb_fix.patch
Description: Binary data

Reply via email to