static void input_linux_event_mouse(void *opaque)

{

    InputLinux *il = opaque;

    struct input_event event;

    int rc;



    for (;;) {

        rc = read(il->fd, &event, sizeof(event));

        if (rc != sizeof(event)) {

            if (rc < 0 && errno != EAGAIN) {

                fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));

                qemu_set_fd_handler(il->fd, NULL, NULL, NULL);

                close(il->fd);

            }

            break;

        }



        input_linux_handle_mouse(il, &event);

    }

}

static void input_linux_event_mouse(void *opaque)

{

    InputLinux *il = opaque;

    struct input_event event;

    int rc;



    for (;;) {

        rc = read(il->fd, &event, sizeof(event));

        if (rc != sizeof(event)) {

            if (rc < 0 && errno != EAGAIN) {

                fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));

                qemu_set_fd_handler(il->fd, NULL, NULL, NULL);

                close(il->fd);

            }

            break;

        }



        input_linux_handle_mouse(il, &event);

    }

}

static void FUNC_0(void *VAR_0)

{

    InputLinux *il = VAR_0;

    struct input_event VAR_1;

    int VAR_2;



    for (;;) {

        VAR_2 = read(il->fd, &VAR_1, sizeof(VAR_1));

        if (VAR_2 != sizeof(VAR_1)) {

            if (VAR_2 < 0 && errno != EAGAIN) {

                fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno));

                qemu_set_fd_handler(il->fd, NULL, NULL, NULL);

                close(il->fd);

            }

            break;

        }



        input_linux_handle_mouse(il, &VAR_1);

    }

}

static void FUNC_0(void *VAR_0)
{ InputLinux *il = VAR_0; struct input_event VAR_1; int VAR_2; for (;;) { VAR_2 = read(il->fd, &VAR_1, sizeof(VAR_1)); if (VAR_2 != sizeof(VAR_1)) { if (VAR_2 < 0 && errno != EAGAIN) { fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno)); qemu_set_fd_handler(il->fd, NULL, NULL, NULL); close(il->fd); } break; } input_linux_handle_mouse(il, &VAR_1); } }