aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Wang <kathy.wangting@huawei.com>2014-10-27 16:51:41 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-27 16:10:53 +0100
commitb7890c40e557f4733b6fcd1eb79af79b70dc8c05 (patch)
tree7b1442d85faf61cc585b210475d50945f2cd5112
parent9aecd6f8aef653cea58932f06a2740299dbe5fd3 (diff)
downloadqemu-b7890c40e557f4733b6fcd1eb79af79b70dc8c05.zip
qemu-b7890c40e557f4733b6fcd1eb79af79b70dc8c05.tar.gz
qemu-b7890c40e557f4733b6fcd1eb79af79b70dc8c05.tar.bz2
virtio-scsi: sense in virtio_scsi_command_complete
If req->resp.cmd.status is not GOOD, the address of sense for qemu_iovec_from_buf should be modified from &req->resp to sense. Cc: qemu-stable@nongnu.org Signed-off-by: Ting Wang <kathy.wangting@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/scsi/virtio-scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 2d2612b..85cd91e 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -448,7 +448,7 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
sense_len = scsi_req_get_sense(r, sense, sizeof(sense));
sense_len = MIN(sense_len, req->resp_iov.size - sizeof(req->resp.cmd));
qemu_iovec_from_buf(&req->resp_iov, sizeof(req->resp.cmd),
- &req->resp, sense_len);
+ sense, sense_len);
req->resp.cmd.sense_len = virtio_tswap32(vdev, sense_len);
}
virtio_scsi_complete_cmd_req(req);