static void close_peer_eventfds(IVShmemState *s, int posn)

{

    int i, n;



    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {

        return;

    }

    if (posn < 0 || posn >= s->nb_peers) {

        error_report("invalid peer %d", posn);

        return;

    }



    n = s->peers[posn].nb_eventfds;



    memory_region_transaction_begin();

    for (i = 0; i < n; i++) {

        ivshmem_del_eventfd(s, posn, i);

    }

    memory_region_transaction_commit();

    for (i = 0; i < n; i++) {

        event_notifier_cleanup(&s->peers[posn].eventfds[i]);

    }



    g_free(s->peers[posn].eventfds);

    s->peers[posn].nb_eventfds = 0;

}

static void close_peer_eventfds(IVShmemState *s, int posn)

{

    int i, n;



    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {

        return;

    }

    if (posn < 0 || posn >= s->nb_peers) {

        error_report("invalid peer %d", posn);

        return;

    }



    n = s->peers[posn].nb_eventfds;



    memory_region_transaction_begin();

    for (i = 0; i < n; i++) {

        ivshmem_del_eventfd(s, posn, i);

    }

    memory_region_transaction_commit();

    for (i = 0; i < n; i++) {

        event_notifier_cleanup(&s->peers[posn].eventfds[i]);

    }



    g_free(s->peers[posn].eventfds);

    s->peers[posn].nb_eventfds = 0;

}

    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {     if (posn < 0 || posn >= s->nb_peers) {         error_report("invalid peer %d", posn);     memory_region_transaction_begin();     for (i = 0; i < n; i++) {         ivshmem_del_eventfd(s, posn, i);     memory_region_transaction_commit();
static void FUNC_0(IVShmemState *VAR_0, int VAR_1)

{

    int VAR_2, VAR_3;



    if (!ivshmem_has_feature(VAR_0, IVSHMEM_IOEVENTFD)) {

        return;

    }

    if (VAR_1 < 0 || VAR_1 >= VAR_0->nb_peers) {

        error_report("invalid peer %d", VAR_1);

        return;

    }



    VAR_3 = VAR_0->peers[VAR_1].nb_eventfds;



    memory_region_transaction_begin();

    for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

        ivshmem_del_eventfd(VAR_0, VAR_1, VAR_2);

    }

    memory_region_transaction_commit();

    for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

        event_notifier_cleanup(&VAR_0->peers[VAR_1].eventfds[VAR_2]);

    }



    g_free(VAR_0->peers[VAR_1].eventfds);

    VAR_0->peers[VAR_1].nb_eventfds = 0;

}

static void FUNC_0(IVShmemState *VAR_0, int VAR_1)
{ int VAR_2, VAR_3; if (!ivshmem_has_feature(VAR_0, IVSHMEM_IOEVENTFD)) { return; } if (VAR_1 < 0 || VAR_1 >= VAR_0->nb_peers) { error_report("invalid peer %d", VAR_1); return; } VAR_3 = VAR_0->peers[VAR_1].nb_eventfds; memory_region_transaction_begin(); for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { ivshmem_del_eventfd(VAR_0, VAR_1, VAR_2); } memory_region_transaction_commit(); for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { event_notifier_cleanup(&VAR_0->peers[VAR_1].eventfds[VAR_2]); } g_free(VAR_0->peers[VAR_1].eventfds); VAR_0->peers[VAR_1].nb_eventfds = 0; }