From e4def80b36231e161b91fa984cd0d73b45668f00 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 6 Sep 2011 18:58:53 +0200 Subject: 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 Signed-off-by: Kevin Wolf --- hw/ide/core.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw/ide') diff --git a/hw/ide/core.c b/hw/ide/core.c index 716addcea3..8f719ee76c 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1795,6 +1795,11 @@ void ide_bus_reset(IDEBus *bus) bus->dma->ops->reset(bus->dma); } +static bool ide_cd_is_tray_open(void *opaque) +{ + return ((IDEState *)opaque)->tray_open; +} + static bool ide_cd_is_medium_locked(void *opaque) { return ((IDEState *)opaque)->tray_locked; @@ -1802,6 +1807,7 @@ static bool ide_cd_is_medium_locked(void *opaque) static const BlockDevOps ide_cd_block_ops = { .change_media_cb = ide_cd_change_cb, + .is_tray_open = ide_cd_is_tray_open, .is_medium_locked = ide_cd_is_medium_locked, }; -- cgit v1.2.3