Am 31.08.2010 11:22, schrieb Bernhard Kohl:
> The header for the MODE SENSE(10) command is 8 bytes long.
>
> Signed-off-by: Bernhard Kohl <address@hidden>
> ---
> hw/scsi-disk.c | 33 +++++++++++++++++++++++++++------
> 1 files changed, 27 insertions(+), 6 deletions(-)
> buflen = p - outbuf;
> - outbuf[0] = buflen - 1;
> + if (req->cmd.buf[0] == MODE_SENSE) {
> + outbuf[0] = buflen - 1;
> + } else { /* MODE_SENSE_10 */
> + outbuf[0] = ((buflen - 1) >> 8) & 0xff;
> + outbuf[1] = (buflen - 1) & 0xff;
Missed that last time, but it should be buflen - 2 here, right? The mode
data length field is two bytes here.
While we're at it, maybe adding a comment before the if wouldn't hurt
which explains why we're subtracting something at all.