From b2077fed7a3e8efa997810e96975551239dc8401 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 14 Nov 2011 14:31:50 +0100 Subject: [PATCH] scsi: remove block descriptors from CDs Reported-by: Thomas Schmitt Tested-by: Thomas Schmitt Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- hw/scsi-disk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.7.4