mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: Show whether the virtual tray is open in info block
Need to ask the device, so this requires new BlockDevOps member is_tray_open(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
9e6a4c9177
commit
e4def80b36
5 changed files with 36 additions and 2 deletions
|
@ -1176,6 +1176,11 @@ static void scsi_cd_change_media_cb(void *opaque)
|
|||
{
|
||||
}
|
||||
|
||||
static bool scsi_cd_is_tray_open(void *opaque)
|
||||
{
|
||||
return ((SCSIDiskState *)opaque)->tray_open;
|
||||
}
|
||||
|
||||
static bool scsi_cd_is_medium_locked(void *opaque)
|
||||
{
|
||||
return ((SCSIDiskState *)opaque)->tray_locked;
|
||||
|
@ -1183,6 +1188,7 @@ static bool scsi_cd_is_medium_locked(void *opaque)
|
|||
|
||||
static const BlockDevOps scsi_cd_block_ops = {
|
||||
.change_media_cb = scsi_cd_change_media_cb,
|
||||
.is_tray_open = scsi_cd_is_tray_open,
|
||||
.is_medium_locked = scsi_cd_is_medium_locked,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue