diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-11-05 14:41:10 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-11-16 09:11:21 +0100 |
commit | af06a0265e31848d895c1bbe173f03607cdba532 (patch) | |
tree | a8e47a608ddac7e7e242a65550dc829bc41be1b8 | |
parent | e315bfd1ba5ece5b8d3fc616219391f2d4b08778 (diff) | |
download | qemu-af06a0265e31848d895c1bbe173f03607cdba532.zip qemu-af06a0265e31848d895c1bbe173f03607cdba532.tar.gz qemu-af06a0265e31848d895c1bbe173f03607cdba532.tar.bz2 |
usb-storage: fill csw on cancel
When scsi requests are canceled fill the csw
(command status word) accordingly.
Buglink: https://bugs.launchpad.net/qemu/+bug/1901981
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20201105134112.25119-5-kraxel@redhat.com
-rw-r--r-- | hw/usb/dev-storage.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 360e8ca..f0f0058 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -327,6 +327,10 @@ static void usb_msd_request_cancelled(SCSIRequest *req) trace_usb_msd_cmd_cancel(req->tag); if (req == s->req) { + s->csw.sig = cpu_to_le32(0x53425355); + s->csw.tag = cpu_to_le32(req->tag); + s->csw.status = 1; /* error */ + scsi_req_unref(s->req); s->req = NULL; s->scsi_len = 0; |