xen: drain submit queue in xen-usb before removing device
commit80440ea033b02d9c7330d507daf41d4bf8a8c058
authorJuergen Gross <jgross@suse.com>
Tue, 2 Aug 2016 12:14:04 +0000 (2 14:14 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 3 Aug 2016 08:29:10 +0000 (3 10:29 +0200)
treee97b751c026cd6c7d81d0d655c4c4dd02d349fd8
parentc8e36e865c8a51c60343246d3a97b47559dc8c63
xen: drain submit queue in xen-usb before removing device

When unplugging a device in the Xen pvusb backend drain the submit
queue before deallocation of the control structures. Otherwise there
will be bogus memory accesses when I/O contracts are finished.

Correlated to this issue is the handling of cancel requests: a packet
cancelled will still lead to the call of complete, so add a flag
to the request indicating it should be just dropped on complete.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-id: 1470140044-16492-3-git-send-email-jgross@suse.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/xen-usb.c