static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
                                   size_t size)
{
    int64_t len;
    if (!bdrv_is_inserted(bs))
        return -ENOMEDIUM;
    if (bs->growable)
        return 0;
    len = bdrv_getlength(bs);
    if (offset < 0)
    if ((offset > len) || (len - offset < size))
    return 0;
static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
                                   size_t size)
{
    int64_t len;
    if (!bdrv_is_inserted(bs))
        return -ENOMEDIUM;
    if (bs->growable)
        return 0;
    len = bdrv_getlength(bs);
    if (offset < 0)
    if ((offset > len) || (len - offset < size))
    return 0;
static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
                                   size_t VAR_2)
{
    int64_t len;
    if (!bdrv_is_inserted(VAR_0))
        return -ENOMEDIUM;
    if (VAR_0->growable)
        return 0;
    len = bdrv_getlength(VAR_0);
    if (VAR_1 < 0)
    if ((VAR_1 > len) || (len - VAR_1 < VAR_2))
    return 0;
static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
size_t VAR_2)
{ int64_t len; if (!bdrv_is_inserted(VAR_0))
return -ENOMEDIUM; if (VAR_0->growable)
return 0; len = bdrv_getlength(VAR_0); if (VAR_1 < 0)
if ((VAR_1 > len) || (len - VAR_1 < VAR_2))
return 0;