migration: Delay start of migration main routines
We need to make sure that we have started all the multifd threads. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
60df2d4ae5
commit
36c2f8be2c
@ -430,7 +430,7 @@ static void migration_incoming_setup(QEMUFile *f)
|
|||||||
qemu_file_set_blocking(f, false);
|
qemu_file_set_blocking(f, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void migration_incoming_process(void)
|
void migration_incoming_process(void)
|
||||||
{
|
{
|
||||||
Coroutine *co = qemu_coroutine_create(process_incoming_migration_co, NULL);
|
Coroutine *co = qemu_coroutine_create(process_incoming_migration_co, NULL);
|
||||||
qemu_coroutine_enter(co);
|
qemu_coroutine_enter(co);
|
||||||
@ -448,7 +448,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc)
|
|||||||
|
|
||||||
if (!mis->from_src_file) {
|
if (!mis->from_src_file) {
|
||||||
QEMUFile *f = qemu_fopen_channel_input(ioc);
|
QEMUFile *f = qemu_fopen_channel_input(ioc);
|
||||||
migration_fd_process_incoming(f);
|
migration_incoming_setup(f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
multifd_recv_new_channel(ioc);
|
multifd_recv_new_channel(ioc);
|
||||||
|
@ -200,6 +200,7 @@ void migrate_set_state(int *state, int old_state, int new_state);
|
|||||||
|
|
||||||
void migration_fd_process_incoming(QEMUFile *f);
|
void migration_fd_process_incoming(QEMUFile *f);
|
||||||
void migration_ioc_process_incoming(QIOChannel *ioc);
|
void migration_ioc_process_incoming(QIOChannel *ioc);
|
||||||
|
void migration_incoming_process(void);
|
||||||
|
|
||||||
bool migration_has_all_channels(void);
|
bool migration_has_all_channels(void);
|
||||||
|
|
||||||
|
@ -717,6 +717,9 @@ void multifd_recv_new_channel(QIOChannel *ioc)
|
|||||||
qemu_thread_create(&p->thread, p->name, multifd_recv_thread, p,
|
qemu_thread_create(&p->thread, p->name, multifd_recv_thread, p,
|
||||||
QEMU_THREAD_JOINABLE);
|
QEMU_THREAD_JOINABLE);
|
||||||
atomic_inc(&multifd_recv_state->count);
|
atomic_inc(&multifd_recv_state->count);
|
||||||
|
if (multifd_recv_state->count == migrate_multifd_channels()) {
|
||||||
|
migration_incoming_process();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,6 +170,10 @@ static void socket_accept_incoming_migration(QIONetListener *listener,
|
|||||||
qio_net_listener_disconnect(listener);
|
qio_net_listener_disconnect(listener);
|
||||||
|
|
||||||
object_unref(OBJECT(listener));
|
object_unref(OBJECT(listener));
|
||||||
|
|
||||||
|
if (!migrate_use_multifd()) {
|
||||||
|
migration_incoming_process();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user