static void tcp_accept_incoming_migration(void *opaque)

{

    struct sockaddr_in addr;

    socklen_t addrlen = sizeof(addr);

    int s = (intptr_t)opaque;

    QEMUFile *f;

    int c;



    do {

        c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);

    } while (c == -1 && socket_error() == EINTR);

    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);

    closesocket(s);



    DPRINTF("accepted migration\n");



    if (c == -1) {

        fprintf(stderr, "could not accept migration connection\n");

        goto out;

    }



    f = qemu_fopen_socket(c, "rb");

    if (f == NULL) {

        fprintf(stderr, "could not qemu_fopen socket\n");

        goto out;

    }



    process_incoming_migration(f);

    return;



out:

    closesocket(c);

}

static void tcp_accept_incoming_migration(void *opaque)

{

    struct sockaddr_in addr;

    socklen_t addrlen = sizeof(addr);

    int s = (intptr_t)opaque;

    QEMUFile *f;

    int c;



    do {

        c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);

    } while (c == -1 && socket_error() == EINTR);

    qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);

    closesocket(s);



    DPRINTF("accepted migration\n");



    if (c == -1) {

        fprintf(stderr, "could not accept migration connection\n");

        goto out;

    }



    f = qemu_fopen_socket(c, "rb");

    if (f == NULL) {

        fprintf(stderr, "could not qemu_fopen socket\n");

        goto out;

    }



    process_incoming_migration(f);

    return;



out:

    closesocket(c);

}

    int c;     } while (c == -1 && socket_error() == EINTR);     if (c == -1) {         fprintf(stderr, "could not accept migration connection\n");         goto out;         fprintf(stderr, "could not qemu_fopen socket\n");     int c;     if (c == -1) {         fprintf(stderr, "could not accept migration connection\n");         goto out;         fprintf(stderr, "could not qemu_fopen socket\n");
static void FUNC_0(void *VAR_0)

{

    struct sockaddr_in VAR_1;

    socklen_t addrlen = sizeof(VAR_1);

    int VAR_2 = (intptr_t)VAR_0;

    QEMUFile *f;

    int VAR_3;



    do {

        VAR_3 = qemu_accept(VAR_2, (struct sockaddr *)&VAR_1, &addrlen);

    } while (VAR_3 == -1 && socket_error() == EINTR);

    qemu_set_fd_handler2(VAR_2, NULL, NULL, NULL, NULL);

    closesocket(VAR_2);



    DPRINTF("accepted migration\n");



    if (VAR_3 == -1) {

        fprintf(stderr, "could not accept migration connection\n");

        goto out;

    }



    f = qemu_fopen_socket(VAR_3, "rb");

    if (f == NULL) {

        fprintf(stderr, "could not qemu_fopen socket\n");

        goto out;

    }



    process_incoming_migration(f);

    return;



out:

    closesocket(VAR_3);

}

static void FUNC_0(void *VAR_0)
{ struct sockaddr_in VAR_1; socklen_t addrlen = sizeof(VAR_1); int VAR_2 = (intptr_t)VAR_0; QEMUFile *f; int VAR_3; do { VAR_3 = qemu_accept(VAR_2, (struct sockaddr *)&VAR_1, &addrlen); } while (VAR_3 == -1 && socket_error() == EINTR); qemu_set_fd_handler2(VAR_2, NULL, NULL, NULL, NULL); closesocket(VAR_2); DPRINTF("accepted migration\n"); if (VAR_3 == -1) { fprintf(stderr, "could not accept migration connection\n"); goto out; } f = qemu_fopen_socket(VAR_3, "rb"); if (f == NULL) { fprintf(stderr, "could not qemu_fopen socket\n"); goto out; } process_incoming_migration(f); return; out:
closesocket(VAR_3); }