From db0284f86a31ec66d138f0f7794321c306af969e Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 19 Oct 2015 17:53:12 +0200 Subject: block: Add blk_is_available() blk_is_available() returns true iff the BDS is inserted (which means blk_bs() is not NULL and bdrv_is_inserted() returns true) and if the tray of the guest device is closed. blk_is_inserted() is changed to return true only if blk_bs() is not NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/sysemu/block-backend.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sysemu') diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 8f2bf10..1e19d1b 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -131,6 +131,7 @@ int blk_enable_write_cache(BlockBackend *blk); void blk_set_enable_write_cache(BlockBackend *blk, bool wce); void blk_invalidate_cache(BlockBackend *blk, Error **errp); bool blk_is_inserted(BlockBackend *blk); +bool blk_is_available(BlockBackend *blk); void blk_lock_medium(BlockBackend *blk, bool locked); void blk_eject(BlockBackend *blk, bool eject_flag); int blk_get_flags(BlockBackend *blk); -- cgit v1.1