int64_t bdrv_getlength(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;



    if (bs->growable || bs->removable) {

        if (drv->bdrv_getlength) {

            return drv->bdrv_getlength(bs);

        }

    }

    return bs->total_sectors * BDRV_SECTOR_SIZE;

}

int64_t bdrv_getlength(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;



    if (bs->growable || bs->removable) {

        if (drv->bdrv_getlength) {

            return drv->bdrv_getlength(bs);

        }

    }

    return bs->total_sectors * BDRV_SECTOR_SIZE;

}

int64_t FUNC_0(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;

    if (!drv)

        return -ENOMEDIUM;



    if (bs->growable || bs->removable) {

        if (drv->FUNC_0) {

            return drv->FUNC_0(bs);

        }

    }

    return bs->total_sectors * BDRV_SECTOR_SIZE;

}

int64_t FUNC_0(BlockDriverState *bs)
{ BlockDriver *drv = bs->drv; if (!drv)
return -ENOMEDIUM; if (bs->growable || bs->removable) { if (drv->FUNC_0) { return drv->FUNC_0(bs); } } return bs->total_sectors * BDRV_SECTOR_SIZE; }