static int find_snapshot_by_id_or_name(BlockDriverState *bs, const char *name)

{

    BDRVQcowState *s = bs->opaque;

    int i, ret;



    ret = find_snapshot_by_id(bs, name);

    if (ret >= 0)

        return ret;

    for(i = 0; i < s->nb_snapshots; i++) {

        if (!strcmp(s->snapshots[i].name, name))

            return i;

    }

    return -1;

}

static int find_snapshot_by_id_or_name(BlockDriverState *bs, const char *name)

{

    BDRVQcowState *s = bs->opaque;

    int i, ret;



    ret = find_snapshot_by_id(bs, name);

    if (ret >= 0)

        return ret;

    for(i = 0; i < s->nb_snapshots; i++) {

        if (!strcmp(s->snapshots[i].name, name))

            return i;

    }

    return -1;

}

    for(i = 0; i < s->nb_snapshots; i++) {             return i; static int find_snapshot_by_id_or_name(BlockDriverState *bs, const char *name)     BDRVQcowState *s = bs->opaque;     int i, ret;     ret = find_snapshot_by_id(bs, name);     if (ret >= 0)     for(i = 0; i < s->nb_snapshots; i++) {         if (!strcmp(s->snapshots[i].name, name))             return i;     return -1;
static int FUNC_0(BlockDriverState *VAR_0, const char *VAR_1)

{

    BDRVQcowState *s = VAR_0->opaque;

    int VAR_2, VAR_3;



    VAR_3 = find_snapshot_by_id(VAR_0, VAR_1);

    if (VAR_3 >= 0)

        return VAR_3;

    for(VAR_2 = 0; VAR_2 < s->nb_snapshots; VAR_2++) {

        if (!strcmp(s->snapshots[VAR_2].VAR_1, VAR_1))

            return VAR_2;

    }

    return -1;

}

static int FUNC_0(BlockDriverState *VAR_0, const char *VAR_1)
{ BDRVQcowState *s = VAR_0->opaque; int VAR_2, VAR_3; VAR_3 = find_snapshot_by_id(VAR_0, VAR_1); if (VAR_3 >= 0)
return VAR_3; for(VAR_2 = 0; VAR_2 < s->nb_snapshots; VAR_2++) { if (!strcmp(s->snapshots[VAR_2].VAR_1, VAR_1))
return VAR_2; } return -1; }