[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/35] ide/atapi: Don't fail eject when tray is alre
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 19/35] ide/atapi: Don't fail eject when tray is already open |
Date: |
Mon, 12 Sep 2011 16:19:18 +0200 |
From: Markus Armbruster <address@hidden>
MMC-5 6.40.2.6 specifies that START STOP UNIT succeeds when the drive
already has the requested state. cmd_start_stop_unit() fails when
asked to eject while the tray is open and locked. Fix that.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/ide/atapi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 06778f3..3f909c3 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -910,7 +910,7 @@ static void cmd_start_stop_unit(IDEState *s, uint8_t* buf)
bool loej = buf[4] & 2; /* load on start, eject on !start */
if (loej) {
- if (!start && s->tray_locked) {
+ if (!start && !s->tray_open && s->tray_locked) {
sense = bdrv_is_inserted(s->bs)
? SENSE_NOT_READY : SENSE_ILLEGAL_REQUEST;
ide_atapi_cmd_error(s, sense, ASC_MEDIA_REMOVAL_PREVENTED);
--
1.7.6
- [Qemu-devel] [PATCH 21/35] ide/atapi: Preserve tray state on migration, (continued)
- [Qemu-devel] [PATCH 21/35] ide/atapi: Preserve tray state on migration, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 12/35] scsi-disk: Track tray locked state, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 15/35] block: Rename bdrv_set_locked() to bdrv_lock_medium(), Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 22/35] block: Clean up remaining users of "removable", Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 20/35] scsi-disk: Fix START_STOP to fail when it can't eject, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 28/35] block: Reset buffer alignment on detach, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 24/35] block: Show whether the virtual tray is open in info block, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 31/35] ide/atapi scsi-disk: Make monitor eject -f, then change work, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 35/35] qcow2: fix range check, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 34/35] qcow2: align cluster_data to block to improve performance using O_DIRECT, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 19/35] ide/atapi: Don't fail eject when tray is already open,
Kevin Wolf <=
- [Qemu-devel] [PATCH 25/35] block: Move BlockConf & friends from block_int.h to block.h, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 26/35] hw: Trim superfluous #include "block_int.h", Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 30/35] block: New change_media_cb() parameter load, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 32/35] qcow2: initialize metadata before inserting in cluster_allocs, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 23/35] block: Drop BlockDriverState member removable, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 33/35] ahci: Remove unused struct member, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 17/35] rbd: clean up, fix style, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 18/35] rbd: fix leak in qemu_rbd_open failure paths, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 29/35] nbd: Clean up use of block_int.h, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 27/35] block: New bdrv_set_buffer_alignment(), Kevin Wolf, 2011/09/12