static int resize_peers(IVShmemState *s, int new_min_size)

{



    int j, old_size;



    /* limit number of max peers */

    if (new_min_size <= 0 || new_min_size > IVSHMEM_MAX_PEERS) {

        return -1;

    }

    if (new_min_size <= s->nb_peers) {

        return 0;

    }



    old_size = s->nb_peers;

    s->nb_peers = new_min_size;



    IVSHMEM_DPRINTF("bumping storage to %d peers\n", s->nb_peers);



    s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));



    for (j = old_size; j < s->nb_peers; j++) {

        s->peers[j].eventfds = g_new0(EventNotifier, s->vectors);

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

    }



    return 0;

}

static int resize_peers(IVShmemState *s, int new_min_size)

{



    int j, old_size;



    

    if (new_min_size <= 0 || new_min_size > IVSHMEM_MAX_PEERS) {

        return -1;

    }

    if (new_min_size <= s->nb_peers) {

        return 0;

    }



    old_size = s->nb_peers;

    s->nb_peers = new_min_size;



    IVSHMEM_DPRINTF("bumping storage to %d peers\n", s->nb_peers);



    s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));



    for (j = old_size; j < s->nb_peers; j++) {

        s->peers[j].eventfds = g_new0(EventNotifier, s->vectors);

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

    }



    return 0;

}

static int resize_peers(IVShmemState *s, int new_min_size)     int j, old_size;     if (new_min_size <= 0 || new_min_size > IVSHMEM_MAX_PEERS) {         return -1;     if (new_min_size <= s->nb_peers) {         return 0;     old_size = s->nb_peers;     s->nb_peers = new_min_size;     IVSHMEM_DPRINTF("bumping storage to %d peers\n", s->nb_peers);     s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));     for (j = old_size; j < s->nb_peers; j++) {         s->peers[j].eventfds = g_new0(EventNotifier, s->vectors);         s->peers[j].nb_eventfds = 0;     return 0;
static int FUNC_0(IVShmemState *VAR_0, int VAR_1)

{



    int VAR_2, VAR_3;



    

    if (VAR_1 <= 0 || VAR_1 > IVSHMEM_MAX_PEERS) {

        return -1;

    }

    if (VAR_1 <= VAR_0->nb_peers) {

        return 0;

    }



    VAR_3 = VAR_0->nb_peers;

    VAR_0->nb_peers = VAR_1;



    IVSHMEM_DPRINTF("bumping storage to %d peers\n", VAR_0->nb_peers);



    VAR_0->peers = g_realloc(VAR_0->peers, VAR_0->nb_peers * sizeof(Peer));



    for (VAR_2 = VAR_3; VAR_2 < VAR_0->nb_peers; VAR_2++) {

        VAR_0->peers[VAR_2].eventfds = g_new0(EventNotifier, VAR_0->vectors);

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

    }



    return 0;

}

static int FUNC_0(IVShmemState *VAR_0, int VAR_1)
{ int VAR_2, VAR_3; if (VAR_1 <= 0 || VAR_1 > IVSHMEM_MAX_PEERS) { return -1; } if (VAR_1 <= VAR_0->nb_peers) { return 0; } VAR_3 = VAR_0->nb_peers; VAR_0->nb_peers = VAR_1; IVSHMEM_DPRINTF("bumping storage to %d peers\n", VAR_0->nb_peers); VAR_0->peers = g_realloc(VAR_0->peers, VAR_0->nb_peers * sizeof(Peer)); for (VAR_2 = VAR_3; VAR_2 < VAR_0->nb_peers; VAR_2++) { VAR_0->peers[VAR_2].eventfds = g_new0(EventNotifier, VAR_0->vectors); VAR_0->peers[VAR_2].nb_eventfds = 0; } return 0; }