From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum5O-0007ln-Gg for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:04:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sum5N-0007TV-By for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:04:14 -0400 Received: from mail-gg0-f173.google.com ([209.85.161.173]:38232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum5N-0007TO-5v for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:04:13 -0400 Received: by ggnp1 with SMTP id p1so3211128ggn.4 for ; Fri, 27 Jul 2012 08:04:12 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 27 Jul 2012 17:02:48 +0200 Message-Id: <1343401379-19495-22-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343401379-19495-1-git-send-email-pbonzini@redhat.com> References: <1343401379-19495-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 21/32] scsi-disk: removable hard disks support load/eject List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- hw/scsi-disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index fb0540a..b52e304 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) -- 1.7.10.4