static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp)

{

    int64_t msg;

    int n, ret;



    n = 0;

    do {

        ret = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + n,

                                   sizeof(msg) - n);

        if (ret < 0) {

            if (ret == -EINTR) {

                continue;

            }

            error_setg_errno(errp, -ret, "read from server failed");

            return INT64_MIN;

        }

        n += ret;

    } while (n < sizeof(msg));



    *pfd = qemu_chr_fe_get_msgfd(&s->server_chr);

    return msg;

}

static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp)

{

    int64_t msg;

    int n, ret;



    n = 0;

    do {

        ret = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + n,

                                   sizeof(msg) - n);

        if (ret < 0) {

            if (ret == -EINTR) {

                continue;

            }

            error_setg_errno(errp, -ret, "read from server failed");

            return INT64_MIN;

        }

        n += ret;

    } while (n < sizeof(msg));



    *pfd = qemu_chr_fe_get_msgfd(&s->server_chr);

    return msg;

}

    return msg;
static int64_t FUNC_0(IVShmemState *s, int *pfd, Error **errp)

{

    int64_t msg;

    int VAR_0, VAR_1;



    VAR_0 = 0;

    do {

        VAR_1 = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + VAR_0,

                                   sizeof(msg) - VAR_0);

        if (VAR_1 < 0) {

            if (VAR_1 == -EINTR) {

                continue;

            }

            error_setg_errno(errp, -VAR_1, "read from server failed");

            return INT64_MIN;

        }

        VAR_0 += VAR_1;

    } while (VAR_0 < sizeof(msg));



    *pfd = qemu_chr_fe_get_msgfd(&s->server_chr);

    return msg;

}

static int64_t FUNC_0(IVShmemState *s, int *pfd, Error **errp)
{ int64_t msg; int VAR_0, VAR_1; VAR_0 = 0; do { VAR_1 = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + VAR_0,
sizeof(msg) - VAR_0); if (VAR_1 < 0) { if (VAR_1 == -EINTR) { continue; } error_setg_errno(errp, -VAR_1, "read from server failed"); return INT64_MIN; } VAR_0 += VAR_1; } while (VAR_0 < sizeof(msg)); *pfd = qemu_chr_fe_get_msgfd(&s->server_chr); return msg; }