aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/block.c b/block.c
index a8c789a079..6fe8addcb7 100644
--- a/block.c
+++ b/block.c
@@ -3026,13 +3026,12 @@ static int coroutine_fn bdrv_co_flush_em(BlockDriverState *bs)
int bdrv_is_inserted(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
- int ret;
+
if (!drv)
return 0;
if (!drv->bdrv_is_inserted)
- return !bs->tray_open;
- ret = drv->bdrv_is_inserted(bs);
- return ret;
+ return 1;
+ return drv->bdrv_is_inserted(bs);
}
/**