aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-07-16 15:59:57 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-07-27 08:25:21 +0200
commitb456a71c4a1eb5704d135fd08da9a0de8fd81231 (patch)
treed6870e472630290e18ae8f97018502713d348047 /hw
parent6a8a685c4d022d4edee57b0fb78c0ae1b4876478 (diff)
scsi-disk: removable hard disks support load/eject
Support for the LOEJ bit of the START/STOP UNIT command right now is limited to CD-ROMs. This is wrong, since removable hard disks (in the real world: SD card readers) also support it in pretty much the same way. Without the LOEJ bit, START/STOP UNIT does nothing for all devices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi-disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index fb0540a3a4..b52e30448a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -1248,7 +1248,7 @@ static int scsi_disk_emulate_start_stop(SCSIDiskReq *r)
bool start = req->cmd.buf[4] & 1;
bool loej = req->cmd.buf[4] & 2; /* load on start, eject on !start */
- if (s->qdev.type == TYPE_ROM && loej) {
+ if ((s->features & (1 << SCSI_DISK_F_REMOVABLE)) && loej) {
if (!start && !s->tray_open && s->tray_locked) {
scsi_check_condition(r,
bdrv_is_inserted(s->qdev.conf.bs)