[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/35] ide/atapi: Track tray locked state
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 11/35] ide/atapi: Track tray locked state |
Date: |
Mon, 12 Sep 2011 16:19:10 +0200 |
From: Markus Armbruster <address@hidden>
We already track it in BlockDriverState. Just like tray open/close
state, we should track it in the device models instead, because it's
device state.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/ide/atapi.c | 4 +++-
hw/ide/internal.h | 1 +
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 0943f66..d9db6de 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -788,8 +788,9 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
buf[12] = 0x71;
buf[13] = 3 << 5;
buf[14] = (1 << 0) | (1 << 3) | (1 << 5);
- if (bdrv_is_locked(s->bs))
+ if (s->tray_locked) {
buf[6] |= 1 << 1;
+ }
buf[15] = 0x00;
cpu_to_ube16(&buf[16], 706);
buf[18] = 0;
@@ -831,6 +832,7 @@ static void cmd_test_unit_ready(IDEState *s, uint8_t *buf)
static void cmd_prevent_allow_medium_removal(IDEState *s, uint8_t* buf)
{
+ s->tray_locked = buf[4] & 1;
bdrv_set_locked(s->bs, buf[4] & 1);
ide_atapi_cmd_ok(s);
}
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 8a9052e..663db39 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -443,6 +443,7 @@ struct IDEState {
uint8_t sense_key;
uint8_t asc;
bool tray_open;
+ bool tray_locked;
uint8_t cdrom_changed;
int packet_transfer_size;
int elementary_transfer_size;
--
1.7.6
- [Qemu-devel] [PULL 00/35] Block patches, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 06/35] ide/atapi: Track tray open/close state, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 04/35] ide: Reject ATA commands specific to drive kinds, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 01/35] qcow2: removed unused depends_on field, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 03/35] ide: Use a table to declare which drive kinds accept each command, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 05/35] ide/atapi: Clean up misleading name in cmd_start_stop_unit(), Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 02/35] ide: Fix ATA command READ to set ATAPI signature for CD-ROM, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 07/35] scsi-disk: Factor out scsi_disk_emulate_start_stop(), Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 08/35] scsi-disk: Track tray open/close state, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 11/35] ide/atapi: Track tray locked state,
Kevin Wolf <=
- [Qemu-devel] [PATCH 10/35] block: Drop tray status tracking, no longer used, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 09/35] block: Revert entanglement of bdrv_is_inserted() with tray status, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 13/35] block: Leave enforcing tray lock to device models, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 14/35] block: Drop medium lock tracking, ask device models instead, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 16/35] rbd: allow client id to be specified in config string, Kevin Wolf, 2011/09/12
- [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