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 + size) > len)

        return -EIO;



    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 + size) > len)

        return -EIO;



    return 0;

}

    if ((offset + size) > len)
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 + VAR_2) > len)

        return -EIO;



    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 + VAR_2) > len)
return -EIO; return 0; }