read-only: Another minor cleanup

Don't rely on CDROM hint for read_only attribute

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Naphtali Sprei 2010-03-11 16:44:34 +02:00 committed by Anthony Liguori
parent 07108b29c5
commit 0056dcc114

View File

@ -613,8 +613,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;