diff options
author | Markus Armbruster <armbru@redhat.com> | 2011-09-06 18:58:46 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-09-12 15:17:20 +0200 |
commit | f107639a6ff0c8d02f6a2dfdfce3a9d9f1e2eb27 (patch) | |
tree | 0c5368f533034b7e1adbd02be5dcff6367cf3a94 /hw/ide | |
parent | fdec4404ddfaf9e121bef84eac1303a8a0e47d75 (diff) |
block: Drop medium lock tracking, ask device models instead
Requires new BlockDevOps member is_medium_locked(). Implement for IDE
and SCSI CD-ROMs.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index b33f84e1af..0403ad24c2 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1795,8 +1795,14 @@ void ide_bus_reset(IDEBus *bus) bus->dma->ops->reset(bus->dma); } +static bool ide_cd_is_medium_locked(void *opaque) +{ + return ((IDEState *)opaque)->tray_locked; +} + static const BlockDevOps ide_cd_block_ops = { .change_media_cb = ide_cd_change_cb, + .is_medium_locked = ide_cd_is_medium_locked, }; int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind, |