示例#1
0
void process_incoming_migration(QEMUFile *f)
{
    Coroutine *co = qemu_coroutine_create(process_incoming_migration_co);
    int fd = qemu_get_fd(f);

    assert(fd != -1);
    qemu_set_nonblock(fd);
    qemu_coroutine_enter(co, f);
}
示例#2
0
文件: exec.c 项目: JMR-b/qemu
void exec_start_incoming_migration(const char *command, Error **errp)
{
    QEMUFile *f;

    DPRINTF("Attempting to start an incoming migration\n");
    f = qemu_popen_cmd(command, "r");
    if(f == NULL) {
        error_setg_errno(errp, errno, "failed to popen the migration source");
        return;
    }

    qemu_set_fd_handler(qemu_get_fd(f), exec_accept_incoming_migration, NULL,
                        f);
}
示例#3
0
/*
 * The meaning of the return values is:
 *   0: We can continue sending
 *   1: Time to stop
 *   negative: There has been an error
 */
static int buffered_get_fd(void *opaque)
{
    QEMUFileBuffered *s = opaque;

    return qemu_get_fd(s->file);
}