mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
8e9e653038
commit
e031f75048
7 changed files with 15 additions and 15 deletions
|
@ -2398,15 +2398,13 @@ out:
|
|||
return prio;
|
||||
}
|
||||
|
||||
static int cdrom_is_inserted(BlockDriverState *bs)
|
||||
static bool cdrom_is_inserted(BlockDriverState *bs)
|
||||
{
|
||||
BDRVRawState *s = bs->opaque;
|
||||
int ret;
|
||||
|
||||
ret = ioctl(s->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
|
||||
if (ret == CDS_DISC_OK)
|
||||
return 1;
|
||||
return 0;
|
||||
return ret == CDS_DISC_OK;
|
||||
}
|
||||
|
||||
static void cdrom_eject(BlockDriverState *bs, bool eject_flag)
|
||||
|
@ -2532,7 +2530,7 @@ static int cdrom_reopen(BlockDriverState *bs)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cdrom_is_inserted(BlockDriverState *bs)
|
||||
static bool cdrom_is_inserted(BlockDriverState *bs)
|
||||
{
|
||||
return raw_getlength(bs) > 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue