aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-10-19 17:53:11 +0200
committerKevin Wolf <kwolf@redhat.com>2015-10-23 18:18:22 +0200
commite031f750483377a5e5de4c92af68dfa68e4d0aae (patch)
tree06482e05eac9020623c7ba715110bb6b9dacad2d /block.c
parent8e9e653038db97bfd343c3fb217b7bf4da765a89 (diff)
block: Make bdrv_is_inserted() return a bool
Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/block.c b/block.c
index d1bf121ffa..bdd33383e8 100644
--- a/block.c
+++ b/block.c
@@ -3140,14 +3140,16 @@ void bdrv_invalidate_cache_all(Error **errp)
/**
* Return TRUE if the media is present
*/
-int bdrv_is_inserted(BlockDriverState *bs)
+bool bdrv_is_inserted(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
- if (!drv)
- return 0;
- if (!drv->bdrv_is_inserted)
- return 1;
+ if (!drv) {
+ return false;
+ }
+ if (!drv->bdrv_is_inserted) {
+ return true;
+ }
return drv->bdrv_is_inserted(bs);
}