From: Ting Wang <kathy.wangting@huawei.com>
To: pbonzini@redhat.com, qemu-devel@nongnu.org
Cc: Ting Wang <kathy.wangting@huawei.com>
Subject: [Qemu-devel] [PATCH] virtio-scsi: sense in virtio_scsi_command_complete
Date: Mon, 27 Oct 2014 16:51:41 +0800 [thread overview]
Message-ID: <1414399901-231824-1-git-send-email-kathy.wangting@huawei.com> (raw)
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);
--
1.8.5
next reply other threads:[~2014-10-27 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 8:51 Ting Wang [this message]
2014-10-27 9:22 ` [Qemu-devel] [PATCH] virtio-scsi: sense in virtio_scsi_command_complete Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414399901-231824-1-git-send-email-kathy.wangting@huawei.com \
--to=kathy.wangting@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).