aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-09-06 18:58:53 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-12 15:17:21 +0200
commite4def80b36231e161b91fa984cd0d73b45668f00 (patch)
tree655c55c6efac3d7a17e3a004ac9889ba32342415 /block.h
parent9e6a4c9177bc95aa04438458d75442e80db9ad33 (diff)
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>
Diffstat (limited to 'block.h')
-rw-r--r--block.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/block.h b/block.h
index e4b55302f7..9f6d02ccdb 100644
--- a/block.h
+++ b/block.h
@@ -38,6 +38,11 @@ typedef struct BlockDevOps {
*/
void (*change_media_cb)(void *opaque);
/*
+ * Is the virtual tray open?
+ * Device models implement this only when the device has a tray.
+ */
+ bool (*is_tray_open)(void *opaque);
+ /*
* Is the virtual medium locked into the device?
* Device models implement this only when device has such a lock.
*/
@@ -101,6 +106,7 @@ void *bdrv_get_attached_dev(BlockDriverState *bs);
void bdrv_set_dev_ops(BlockDriverState *bs, const BlockDevOps *ops,
void *opaque);
bool bdrv_dev_has_removable_media(BlockDriverState *bs);
+bool bdrv_dev_is_tray_open(BlockDriverState *bs);
bool bdrv_dev_is_medium_locked(BlockDriverState *bs);
int bdrv_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors);