void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap)

{

    bool has_reply = false;

    int nesting = 0;



    /* Send QMP request */

    socket_sendf(s->qmp_fd, fmt, ap);



    /* Receive reply */

    while (!has_reply || nesting > 0) {

        ssize_t len;

        char c;



        len = read(s->qmp_fd, &c, 1);

        if (len == -1 && errno == EINTR) {

            continue;

        }



        if (len == -1 || len == 0) {

            fprintf(stderr, "Broken pipe\n");

            exit(1);

        }



        switch (c) {

        case '{':

            nesting++;

            has_reply = true;

            break;

        case '}':

            nesting--;

            break;

        }

    }

}

void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap)

{

    bool has_reply = false;

    int nesting = 0;



    

    socket_sendf(s->qmp_fd, fmt, ap);



    

    while (!has_reply || nesting > 0) {

        ssize_t len;

        char c;



        len = read(s->qmp_fd, &c, 1);

        if (len == -1 && errno == EINTR) {

            continue;

        }



        if (len == -1 || len == 0) {

            fprintf(stderr, "Broken pipe\n");

            exit(1);

        }



        switch (c) {

        case '{':

            nesting++;

            has_reply = true;

            break;

        case '}':

            nesting--;

            break;

        }

    }

}

void qtest_qmpv_discard_response(QTestState *s, const char *fmt, va_list ap)     bool has_reply = false;     int nesting = 0;     while (!has_reply || nesting > 0) {         switch (c) {         case '{':             nesting++;             has_reply = true;             break;         case '}':             nesting--;             break;
void FUNC_0(QTestState *VAR_0, const char *VAR_1, va_list VAR_2)

{

    bool has_reply = false;

    int VAR_3 = 0;



    

    socket_sendf(VAR_0->qmp_fd, VAR_1, VAR_2);



    

    while (!has_reply || VAR_3 > 0) {

        ssize_t len;

        char VAR_4;



        len = read(VAR_0->qmp_fd, &VAR_4, 1);

        if (len == -1 && errno == EINTR) {

            continue;

        }



        if (len == -1 || len == 0) {

            fprintf(stderr, "Broken pipe\n");

            exit(1);

        }



        switch (VAR_4) {

        case '{':

            VAR_3++;

            has_reply = true;

            break;

        case '}':

            VAR_3--;

            break;

        }

    }

}

void FUNC_0(QTestState *VAR_0, const char *VAR_1, va_list VAR_2)
{ bool has_reply = false; int VAR_3 = 0; socket_sendf(VAR_0->qmp_fd, VAR_1, VAR_2); while (!has_reply || VAR_3 > 0) { ssize_t len; char VAR_4; len = read(VAR_0->qmp_fd, &VAR_4, 1); if (len == -1 && errno == EINTR) { continue; } if (len == -1 || len == 0) { fprintf(stderr, "Broken pipe\n"); exit(1); } switch (VAR_4) { case '{': VAR_3++; has_reply = true; break; case '}': VAR_3--; break; } } }