summaryrefslogtreecommitdiff
path: root/hw/scsi-bus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-06 12:31:43 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 15:28:37 +0200
commiteae31cb99810c362955f37f82573f2e3849bcd32 (patch)
treeff8b7b25294ad70e4167fc0750f068aefe423a1a /hw/scsi-bus.c
parentf651526271fb0b3d12f07f0810d80512edf384ad (diff)
scsi: fill in additional sense length correctly
Even though we do not use them, we should include the last three bytes of sense data in the additional sense length. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-bus.c')
-rw-r--r--hw/scsi-bus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index d6fd19a78b..160eaee693 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -498,6 +498,7 @@ void scsi_req_build_sense(SCSIRequest *req, SCSISense sense)
memset(req->sense, 0, 18);
req->sense[0] = 0xf0;
req->sense[2] = sense.key;
+ req->sense[7] = 10;
req->sense[12] = sense.asc;
req->sense[13] = sense.ascq;
req->sense_len = 18;
@@ -883,7 +884,7 @@ int scsi_build_sense(uint8_t *in_buf, int in_len,
/* Return fixed format sense buffer */
buf[0] = 0xf0;
buf[2] = sense.key;
- buf[7] = 7;
+ buf[7] = 10;
buf[12] = sense.asc;
buf[13] = sense.ascq;
return MIN(len, 18);