diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-11-14 14:31:50 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-11-18 14:09:05 +0100 |
commit | 0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0 (patch) | |
tree | 0fd8dad47e4d6fba4a2b65d115f479e5c97e455a | |
parent | 06b863577e960413466560d44e2e38eaaca1257e (diff) | |
download | qemu-0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0.zip qemu-0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0.tar.gz qemu-0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0.tar.bz2 |
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>
-rw-r--r-- | hw/scsi-disk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 0b06fef..9dd2be8 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -956,8 +956,9 @@ static int scsi_disk_emulate_mode_sense(SCSIDiskReq *r, uint8_t *outbuf) p += 8; } + /* MMC prescribes that CD/DVD drives have no block descriptors. */ 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) { outbuf[3] = 8; /* Block descriptor length */ } else { /* MODE_SENSE_10 */ |