void *laio_init(void)

{

    struct qemu_laio_state *s;



    s = qemu_mallocz(sizeof(*s));

    QLIST_INIT(&s->completed_reqs);

    s->efd = eventfd(0, 0);

    if (s->efd == -1)

        goto out_free_state;

    fcntl(s->efd, F_SETFL, O_NONBLOCK);



    if (io_setup(MAX_EVENTS, &s->ctx) != 0)

        goto out_close_efd;



    qemu_aio_set_fd_handler(s->efd, qemu_laio_completion_cb, NULL,

        qemu_laio_flush_cb, qemu_laio_process_requests, s);



    return s;



out_close_efd:

    close(s->efd);

out_free_state:

    qemu_free(s);

    return NULL;

}

void *laio_init(void)

{

    struct qemu_laio_state *s;



    s = qemu_mallocz(sizeof(*s));

    QLIST_INIT(&s->completed_reqs);

    s->efd = eventfd(0, 0);

    if (s->efd == -1)

        goto out_free_state;

    fcntl(s->efd, F_SETFL, O_NONBLOCK);



    if (io_setup(MAX_EVENTS, &s->ctx) != 0)

        goto out_close_efd;



    qemu_aio_set_fd_handler(s->efd, qemu_laio_completion_cb, NULL,

        qemu_laio_flush_cb, qemu_laio_process_requests, s);



    return s;



out_close_efd:

    close(s->efd);

out_free_state:

    qemu_free(s);

    return NULL;

}

void *FUNC_0(void)

{

    struct qemu_laio_state *VAR_0;



    VAR_0 = qemu_mallocz(sizeof(*VAR_0));

    QLIST_INIT(&VAR_0->completed_reqs);

    VAR_0->efd = eventfd(0, 0);

    if (VAR_0->efd == -1)

        goto out_free_state;

    fcntl(VAR_0->efd, F_SETFL, O_NONBLOCK);



    if (io_setup(MAX_EVENTS, &VAR_0->ctx) != 0)

        goto out_close_efd;



    qemu_aio_set_fd_handler(VAR_0->efd, qemu_laio_completion_cb, NULL,

        qemu_laio_flush_cb, qemu_laio_process_requests, VAR_0);



    return VAR_0;



out_close_efd:

    close(VAR_0->efd);

out_free_state:

    qemu_free(VAR_0);

    return NULL;

}

void *FUNC_0(void)
{ struct qemu_laio_state *VAR_0; VAR_0 = qemu_mallocz(sizeof(*VAR_0)); QLIST_INIT(&VAR_0->completed_reqs); VAR_0->efd = eventfd(0, 0); if (VAR_0->efd == -1)
goto out_free_state; fcntl(VAR_0->efd, F_SETFL, O_NONBLOCK); if (io_setup(MAX_EVENTS, &VAR_0->ctx) != 0)
goto out_close_efd; qemu_aio_set_fd_handler(VAR_0->efd, qemu_laio_completion_cb, NULL,
qemu_laio_flush_cb, qemu_laio_process_requests, VAR_0); return VAR_0; out_close_efd:
close(VAR_0->efd); out_free_state:
qemu_free(VAR_0); return NULL; }