static void close_guest_eventfds(IVShmemState *s, int posn)

{

    int i, guest_curr_max;



    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {








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



    memory_region_transaction_begin();

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

        ivshmem_del_eventfd(s, posn, i);


    memory_region_transaction_commit();

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

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




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

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

static void close_guest_eventfds(IVShmemState *s, int posn)

{

    int i, guest_curr_max;



    if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {








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



    memory_region_transaction_begin();

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

        ivshmem_del_eventfd(s, posn, i);


    memory_region_transaction_commit();

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

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




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

    s->peers[posn].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)) {








    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)) { 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;