From: Paolo Bonzini Date: Mon, 14 Nov 2011 13:31:50 +0000 (+0100) Subject: scsi: remove block descriptors from CDs X-Git-Tag: v1.0-rc3~17^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0fd76ff40b43f5c9f02086a8d53c6157fc0d94a0;p=qemu-xen-4.4-testing.git scsi: remove block descriptors from CDs Reported-by: Thomas Schmitt Tested-by: Thomas Schmitt Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 0b06fefc1..9dd2be886 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 */