Patchwork [2/2] read-only: Another minor cleanup

login
register
mail settings
Submitter Naphtali Sprei
Date March 11, 2010, 2:44 p.m.
Message ID <1268318674-10607-2-git-send-email-nsprei@redhat.com>
Download mbox | patch
Permalink /patch/47336/
State New
Headers show

Comments

Naphtali Sprei - March 11, 2010, 2:44 p.m.
Don't rely on CDROM hint for read_only attribute

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 hw/scsi-disk.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 8f7ffc1..5cd6ae6 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -612,8 +612,7 @@  static int scsi_disk_emulate_mode_sense(SCSIRequest *req, uint8_t *outbuf)
 
     p[1] = 0; /* Default media type.  */
     p[3] = 0; /* Block descriptor length.  */
-    if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM ||
-        bdrv_is_read_only(s->bs)) {
+    if (bdrv_is_read_only(s->bs)) {
         p[2] = 0x80; /* Readonly.  */
     }
     p += 4;