scsi: remove block descriptors from CDs
Reported-by: Thomas Schmitt <scdbackup@gmx.net> Tested-by: Thomas Schmitt <scdbackup@gmx.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
06b863577e
commit
0fd76ff40b
1 changed files with 2 additions and 1 deletions
|
@ -956,8 +956,9 @@ static int scsi_disk_emulate_mode_sense(SCSIDiskReq *r, uint8_t *outbuf)
|
||||||
p += 8;
|
p += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MMC prescribes that CD/DVD drives have no block descriptors. */
|
||||||
bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);
|
bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);
|
||||||
if (!dbd && nb_sectors) {
|
if (!dbd && s->qdev.type == TYPE_DISK && nb_sectors) {
|
||||||
if (r->req.cmd.buf[0] == MODE_SENSE) {
|
if (r->req.cmd.buf[0] == MODE_SENSE) {
|
||||||
outbuf[3] = 8; /* Block descriptor length */
|
outbuf[3] = 8; /* Block descriptor length */
|
||||||
} else { /* MODE_SENSE_10 */
|
} else { /* MODE_SENSE_10 */
|
||||||
|
|
Reference in a new issue