static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,

                              const char *name)

{

    QEMUSnapshotInfo *sn_tab, *sn;

    int nb_sns, i, ret;



    ret = -ENOENT;

    nb_sns = bdrv_snapshot_list(bs, &sn_tab);

    if (nb_sns < 0)

        return ret;

    for(i = 0; i < nb_sns; i++) {

        sn = &sn_tab[i];

        if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {

            *sn_info = *sn;

            ret = 0;

            break;

        }

    }

    g_free(sn_tab);

    return ret;

}

static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,

                              const char *name)

{

    QEMUSnapshotInfo *sn_tab, *sn;

    int nb_sns, i, ret;



    ret = -ENOENT;

    nb_sns = bdrv_snapshot_list(bs, &sn_tab);

    if (nb_sns < 0)

        return ret;

    for(i = 0; i < nb_sns; i++) {

        sn = &sn_tab[i];

        if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {

            *sn_info = *sn;

            ret = 0;

            break;

        }

    }

    g_free(sn_tab);

    return ret;

}

static int FUNC_0(BlockDriverState *VAR_0, QEMUSnapshotInfo *VAR_1,

                              const char *VAR_2)

{

    QEMUSnapshotInfo *sn_tab, *sn;

    int VAR_3, VAR_4, VAR_5;



    VAR_5 = -ENOENT;

    VAR_3 = bdrv_snapshot_list(VAR_0, &sn_tab);

    if (VAR_3 < 0)

        return VAR_5;

    for(VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) {

        sn = &sn_tab[VAR_4];

        if (!strcmp(sn->id_str, VAR_2) || !strcmp(sn->VAR_2, VAR_2)) {

            *VAR_1 = *sn;

            VAR_5 = 0;

            break;

        }

    }

    g_free(sn_tab);

    return VAR_5;

}

static int FUNC_0(BlockDriverState *VAR_0, QEMUSnapshotInfo *VAR_1,
const char *VAR_2)
{ QEMUSnapshotInfo *sn_tab, *sn; int VAR_3, VAR_4, VAR_5; VAR_5 = -ENOENT; VAR_3 = bdrv_snapshot_list(VAR_0, &sn_tab); if (VAR_3 < 0)
return VAR_5; for(VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) { sn = &sn_tab[VAR_4]; if (!strcmp(sn->id_str, VAR_2) || !strcmp(sn->VAR_2, VAR_2)) { *VAR_1 = *sn; VAR_5 = 0; break; } } g_free(sn_tab); return VAR_5; }