qemu-stable
[Top][All Lists]
Advanced

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

[Qemu-stable] [PULL 26/28] virtio-scsi: sense in virtio_scsi_command_com


From: Paolo Bonzini
Subject: [Qemu-stable] [PULL 26/28] virtio-scsi: sense in virtio_scsi_command_complete
Date: Mon, 27 Oct 2014 16:13:43 +0100

From: Ting Wang <address@hidden>

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: address@hidden
Signed-off-by: Ting Wang <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/scsi/virtio-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
1.8.3.1





reply via email to

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