Message ID | 1414399901-231824-1-git-send-email-kathy.wangting@huawei.com |
---|---|
State | New |
Headers | show |
On 10/27/2014 09:51 AM, Ting Wang wrote: > 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. > > Signed-off-by: Ting Wang <kathy.wangting@huawei.com> > --- > 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 a1725b8..fe094a5 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); > Embarrassing. Thanks, applied. Paolo
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index a1725b8..fe094a5 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);
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. Signed-off-by: Ting Wang <kathy.wangting@huawei.com> --- hw/scsi/virtio-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)