int64_t bdrv_nb_sectors(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;



    if (!drv)

        return -ENOMEDIUM;



    if (drv->has_variable_length) {

        int ret = refresh_total_sectors(bs, bs->total_sectors);

        if (ret < 0) {

            return ret;

        }

    }

    return bs->total_sectors;

}

int64_t bdrv_nb_sectors(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;



    if (!drv)

        return -ENOMEDIUM;



    if (drv->has_variable_length) {

        int ret = refresh_total_sectors(bs, bs->total_sectors);

        if (ret < 0) {

            return ret;

        }

    }

    return bs->total_sectors;

}

int64_t FUNC_0(BlockDriverState *bs)

{

    BlockDriver *drv = bs->drv;



    if (!drv)

        return -ENOMEDIUM;



    if (drv->has_variable_length) {

        int VAR_0 = refresh_total_sectors(bs, bs->total_sectors);

        if (VAR_0 < 0) {

            return VAR_0;

        }

    }

    return bs->total_sectors;

}

int64_t FUNC_0(BlockDriverState *bs)
{ BlockDriver *drv = bs->drv; if (!drv)
return -ENOMEDIUM; if (drv->has_variable_length) { int VAR_0 = refresh_total_sectors(bs, bs->total_sectors); if (VAR_0 < 0) { return VAR_0; } } return bs->total_sectors; }