Factorize common migration incoming code

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Juan Quintela 2010-06-09 14:10:55 +02:00 committed by Anthony Liguori
parent 8ca5e80118
commit 511c023103
6 changed files with 21 additions and 52 deletions

View file

@ -121,20 +121,8 @@ err_after_alloc:
static void exec_accept_incoming_migration(void *opaque)
{
QEMUFile *f = opaque;
int ret;
ret = qemu_loadvm_state(f);
if (ret < 0) {
fprintf(stderr, "load of migration failed\n");
goto err;
}
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
if (autostart)
vm_start();
err:
process_incoming_migration(f);
qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
qemu_fclose(f);
}