]> git.proxmox.com Git - qemu.git/commit
usb-redir: Don't handle interrupt output packets async
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Nov 2012 11:26:57 +0000 (12:26 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Nov 2012 13:55:54 +0000 (14:55 +0100)
commit723aedd53281cfa0997457cb156a59909a75f5a8
treeee84f91031d3d958bcc93166fcece769c6d74cf9
parent234e810cce018daf2030e04e399a17b744fa3e0d
usb-redir: Don't handle interrupt output packets async

Instead report them as successfully completed directly on submission, this
has 2 advantages:

1) This matches the timing of interrupt output packets on real hardware,
with the previous async handling, if an ep has an interval of say 500 ms,
then there would be 500+ ms between the submission and the guest seeing the
completion, as we wont do the write back until the qh gets polled again. And
in the mean time the guest may very well have timed out, as the guest can
reasonable expect a much quicker completion.

2) This fixes interrupt output packets potentially getting send twice
surrounding a migration. As we delay the writeback to guest memory until
the qh gets polled again, there is a window between completion and writeback
where migration can happen, in this case the destination will not know
about the completion, and it will execute the packet *again*

But it does also come with a disadvantage:

1) If the actual interrupt out to the real usb device fails, there is no
way to report this back to the guest.

This patch assumes however that interrupt outs in practice never fail, as
they are only used by specialized drivers, which are unlikely to issue illegal
requests (unlike general class drivers which often issue requests which some
devices don't implement). And that thus the advantages outway the disadvantage.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/redirect.c