qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 29/60] usb-storage: fix SYNCHRONIZE_CACHE


From: Michael Tokarev
Subject: [Qemu-devel] [PATCH 29/60] usb-storage: fix SYNCHRONIZE_CACHE
Date: Mon, 4 Feb 2013 14:40:39 +0400

From: Gerd Hoffmann <address@hidden>

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 <address@hidden>
(cherry picked from commit 54414218d78c9d043417b27bb29bd0334b4e3cb5)

Signed-off-by: Michael Tokarev <address@hidden>
---
 hw/usb/dev-storage.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index ae22fb1..3a993d3 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);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]