qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 4/6] scsi: remove block descriptors from CDs


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH v2 4/6] scsi: remove block descriptors from CDs
Date: Mon, 14 Nov 2011 14:31:50 +0100

Reported-by: Thomas Schmitt <address@hidden>
Tested-by: Thomas Schmitt <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 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 5ce17e7..9224b04 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -987,8 +987,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 */
-- 
1.7.7.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]