static int qcow2_is_allocated(BlockDriverState *bs, int64_t sector_num,

                              int nb_sectors, int *pnum)

{

    uint64_t cluster_offset;

    int ret;



    *pnum = nb_sectors;

    /* FIXME We can get errors here, but the bdrv_is_allocated interface can't

     * pass them on today */

    ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset);

    if (ret < 0) {

        *pnum = 0;

    }



    return (cluster_offset != 0);

}

static int qcow2_is_allocated(BlockDriverState *bs, int64_t sector_num,

                              int nb_sectors, int *pnum)

{

    uint64_t cluster_offset;

    int ret;



    *pnum = nb_sectors;

    



    ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset);

    if (ret < 0) {

        *pnum = 0;

    }



    return (cluster_offset != 0);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,

                              int VAR_2, int *VAR_3)

{

    uint64_t cluster_offset;

    int VAR_4;



    *VAR_3 = VAR_2;

    



    VAR_4 = qcow2_get_cluster_offset(VAR_0, VAR_1 << 9, VAR_3, &cluster_offset);

    if (VAR_4 < 0) {

        *VAR_3 = 0;

    }



    return (cluster_offset != 0);

}

static int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
int VAR_2, int *VAR_3)
{ uint64_t cluster_offset; int VAR_4; *VAR_3 = VAR_2; VAR_4 = qcow2_get_cluster_offset(VAR_0, VAR_1 << 9, VAR_3, &cluster_offset); if (VAR_4 < 0) { *VAR_3 = 0; } return (cluster_offset != 0); }