scsi: fill in additional sense length correctly
PATCH 1/1 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 <[email protected]>
--- hw/scsi-bus.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
hw/scsi-bus.c +2 -1
@@ -501,6 +501,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 ;
@@ -887,7 +888,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 );
Signature · 1 line
1.7.6
Kevin Wolf
AppliedAm 06.09.2011 12:31, schrieb Paolo Bonzini:
Quoted 4 lines
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 <[email protected]>
Thanks, applied to the block branch.
Kevin