mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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:
parent
8ca5e80118
commit
511c023103
6 changed files with 21 additions and 52 deletions
|
@ -149,7 +149,7 @@ static void unix_accept_incoming_migration(void *opaque)
|
|||
socklen_t addrlen = sizeof(addr);
|
||||
int s = (unsigned long)opaque;
|
||||
QEMUFile *f;
|
||||
int c, ret;
|
||||
int c;
|
||||
|
||||
do {
|
||||
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
|
||||
|
@ -168,18 +168,7 @@ static void unix_accept_incoming_migration(void *opaque)
|
|||
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");
|
||||
|
||||
if (autostart)
|
||||
vm_start();
|
||||
|
||||
out_fopen:
|
||||
process_incoming_migration(f);
|
||||
qemu_fclose(f);
|
||||
out:
|
||||
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue