static void vm_completion(ReadLineState *rs, const char *str)

{

    size_t len;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    len = strlen(str);

    readline_set_completion_index(rs, len);



    while ((it = bdrv_next(it, &bs))) {

        SnapshotInfoList *snapshots, *snapshot;

        AioContext *ctx = bdrv_get_aio_context(bs);

        bool ok = false;



        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0;

        }

        aio_context_release(ctx);

        if (!ok) {

            continue;

        }



        snapshot = snapshots;

        while (snapshot) {

            char *completion = snapshot->value->name;

            if (!strncmp(str, completion, len)) {

                readline_add_completion(rs, completion);

            }

            completion = snapshot->value->id;

            if (!strncmp(str, completion, len)) {

                readline_add_completion(rs, completion);

            }

            snapshot = snapshot->next;

        }

        qapi_free_SnapshotInfoList(snapshots);

    }



}

static void vm_completion(ReadLineState *rs, const char *str)

{

    size_t len;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    len = strlen(str);

    readline_set_completion_index(rs, len);



    while ((it = bdrv_next(it, &bs))) {

        SnapshotInfoList *snapshots, *snapshot;

        AioContext *ctx = bdrv_get_aio_context(bs);

        bool ok = false;



        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0;

        }

        aio_context_release(ctx);

        if (!ok) {

            continue;

        }



        snapshot = snapshots;

        while (snapshot) {

            char *completion = snapshot->value->name;

            if (!strncmp(str, completion, len)) {

                readline_add_completion(rs, completion);

            }

            completion = snapshot->value->id;

            if (!strncmp(str, completion, len)) {

                readline_add_completion(rs, completion);

            }

            snapshot = snapshot->next;

        }

        qapi_free_SnapshotInfoList(snapshots);

    }



}

    BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BlockDriverState *bs;     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs))) {     while ((it = bdrv_next(it, &bs))) {     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs))) {     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs))) {     BdrvNextIterator *it = NULL;     while ((it = bdrv_next(it, &bs))) {     while ((it = bdrv_next(it, &bs))) {
static void FUNC_0(ReadLineState *VAR_0, const char *VAR_1)

{

    size_t len;

    BlockDriverState *bs;

    BdrvNextIterator *it = NULL;



    len = strlen(VAR_1);

    readline_set_completion_index(VAR_0, len);



    while ((it = bdrv_next(it, &bs))) {

        SnapshotInfoList *snapshots, *snapshot;

        AioContext *ctx = bdrv_get_aio_context(bs);

        bool ok = false;



        aio_context_acquire(ctx);

        if (bdrv_can_snapshot(bs)) {

            ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0;

        }

        aio_context_release(ctx);

        if (!ok) {

            continue;

        }



        snapshot = snapshots;

        while (snapshot) {

            char *VAR_2 = snapshot->value->name;

            if (!strncmp(VAR_1, VAR_2, len)) {

                readline_add_completion(VAR_0, VAR_2);

            }

            VAR_2 = snapshot->value->id;

            if (!strncmp(VAR_1, VAR_2, len)) {

                readline_add_completion(VAR_0, VAR_2);

            }

            snapshot = snapshot->next;

        }

        qapi_free_SnapshotInfoList(snapshots);

    }



}

static void FUNC_0(ReadLineState *VAR_0, const char *VAR_1)
{ size_t len; BlockDriverState *bs; BdrvNextIterator *it = NULL; len = strlen(VAR_1); readline_set_completion_index(VAR_0, len); while ((it = bdrv_next(it, &bs))) { SnapshotInfoList *snapshots, *snapshot; AioContext *ctx = bdrv_get_aio_context(bs); bool ok = false; aio_context_acquire(ctx); if (bdrv_can_snapshot(bs)) { ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0; } aio_context_release(ctx); if (!ok) { continue; } snapshot = snapshots; while (snapshot) { char *VAR_2 = snapshot->value->name; if (!strncmp(VAR_1, VAR_2, len)) { readline_add_completion(VAR_0, VAR_2); } VAR_2 = snapshot->value->id; if (!strncmp(VAR_1, VAR_2, len)) { readline_add_completion(VAR_0, VAR_2); } snapshot = snapshot->next; } qapi_free_SnapshotInfoList(snapshots); } }