static void unix_accept_incoming_migration(void *opaque)

{

    struct sockaddr_un addr;

    socklen_t addrlen = sizeof(addr);

    int s = (unsigned long)opaque;

    QEMUFile *f;

    int c, ret;



    do {

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

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



    dprintf("accepted migration\n");



    if (c == -1) {

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

        return;

    }



    f = qemu_fopen_socket(c);

    if (f == NULL) {

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

        goto out;

    }



    ret = qemu_loadvm_state(f);

    if (ret < 0) {

        fprintf(stderr, "load of migration failed\n");

        goto out_fopen;

    }

    qemu_announce_self();

    dprintf("successfully loaded vm state\n");



    /* we've successfully migrated, close the server socket */

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

    close(s);



out_fopen:

    qemu_fclose(f);

out:

    close(c);

}

static void unix_accept_incoming_migration(void *opaque)

{

    struct sockaddr_un addr;

    socklen_t addrlen = sizeof(addr);

    int s = (unsigned long)opaque;

    QEMUFile *f;

    int c, ret;



    do {

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

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



    dprintf("accepted migration\n");



    if (c == -1) {

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

        return;

    }



    f = qemu_fopen_socket(c);

    if (f == NULL) {

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

        goto out;

    }



    ret = qemu_loadvm_state(f);

    if (ret < 0) {

        fprintf(stderr, "load of migration failed\n");

        goto out_fopen;

    }

    qemu_announce_self();

    dprintf("successfully loaded vm state\n");



    

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

    close(s);



out_fopen:

    qemu_fclose(f);

out:

    close(c);

}

        c = accept(s, (struct sockaddr *)&addr, &addrlen);         c = accept(s, (struct sockaddr *)&addr, &addrlen);
static void FUNC_0(void *VAR_0)

{

    struct sockaddr_un VAR_1;

    socklen_t addrlen = sizeof(VAR_1);

    int VAR_2 = (unsigned long)VAR_0;

    QEMUFile *f;

    int VAR_3, VAR_4;



    do {

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

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



    dprintf("accepted migration\n");



    if (VAR_3 == -1) {

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

        return;

    }



    f = qemu_fopen_socket(VAR_3);

    if (f == NULL) {

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

        goto out;

    }



    VAR_4 = qemu_loadvm_state(f);

    if (VAR_4 < 0) {

        fprintf(stderr, "load of migration failed\n");

        goto out_fopen;

    }

    qemu_announce_self();

    dprintf("successfully loaded vm state\n");



    

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

    close(VAR_2);



out_fopen:

    qemu_fclose(f);

out:

    close(VAR_3);

}

static void FUNC_0(void *VAR_0)
{ struct sockaddr_un VAR_1; socklen_t addrlen = sizeof(VAR_1); int VAR_2 = (unsigned long)VAR_0; QEMUFile *f; int VAR_3, VAR_4; do { VAR_3 = accept(VAR_2, (struct sockaddr *)&VAR_1, &addrlen); } while (VAR_3 == -1 && socket_error() == EINTR); dprintf("accepted migration\n"); if (VAR_3 == -1) { fprintf(stderr, "could not accept migration connection\n"); return; } f = qemu_fopen_socket(VAR_3); if (f == NULL) { fprintf(stderr, "could not qemu_fopen socket\n"); goto out; } VAR_4 = qemu_loadvm_state(f); if (VAR_4 < 0) { fprintf(stderr, "load of migration failed\n"); goto out_fopen; } qemu_announce_self(); dprintf("successfully loaded vm state\n"); qemu_set_fd_handler2(VAR_2, NULL, NULL, NULL, NULL); close(VAR_2); out_fopen:
qemu_fclose(f); out:
close(VAR_3); }