mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
fdec4404dd
commit
f107639a6f
6 changed files with 32 additions and 10 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue