summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-07-13 11:38:13 +0200
committerDoug Goldstein <cardoe@cardoe.com>2012-11-21 15:24:59 -0600
commitf00280ab8e0c4d425bef788c8d0e2653d323130d (patch)
treec9c57245363fb7dfea2ae8fdb47fb79ffea92173
parentFixes related to processing of qemu's -numa option (diff)
downloadqemu-kvm-f00280ab8e0c4d425bef788c8d0e2653d323130d.tar.gz
qemu-kvm-f00280ab8e0c4d425bef788c8d0e2653d323130d.tar.bz2
qemu-kvm-f00280ab8e0c4d425bef788c8d0e2653d323130d.zip
usb-storage: fix SYNCHRONIZE_CACHE
Commit 59310659073d85745854f2f10c4292555c5a1c51 is incomplete, we'll arrive in the scsi command complete callback in CSW state and must handle that case correctly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 54414218d78c9d043417b27bb29bd0334b4e3cb5)
-rw-r--r--hw/usb/dev-storage.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index ae22fb1c9..3a993d343 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -242,6 +242,9 @@ static void usb_msd_command_complete(SCSIRequest *req, uint32_t status, size_t r
the status read packet. */
usb_msd_send_status(s, p);
s->mode = USB_MSDM_CBW;
+ } else if (s->mode == USB_MSDM_CSW) {
+ usb_msd_send_status(s, p);
+ s->mode = USB_MSDM_CBW;
} else {
if (s->data_len) {
int len = (p->iov.size - p->result);