|
@@ -511,17 +511,31 @@ void migration_fd_process_incoming(QEMUFile *f)
|
|
void migration_ioc_process_incoming(QIOChannel *ioc)
|
|
void migration_ioc_process_incoming(QIOChannel *ioc)
|
|
{
|
|
{
|
|
MigrationIncomingState *mis = migration_incoming_get_current();
|
|
MigrationIncomingState *mis = migration_incoming_get_current();
|
|
|
|
+ bool start_migration;
|
|
|
|
|
|
if (!mis->from_src_file) {
|
|
if (!mis->from_src_file) {
|
|
|
|
+ /* The first connection (multifd may have multiple) */
|
|
QEMUFile *f = qemu_fopen_channel_input(ioc);
|
|
QEMUFile *f = qemu_fopen_channel_input(ioc);
|
|
|
|
+
|
|
|
|
+ /* If it's a recovery, we're done */
|
|
if (postcopy_try_recover(f)) {
|
|
if (postcopy_try_recover(f)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
migration_incoming_setup(f);
|
|
migration_incoming_setup(f);
|
|
- return;
|
|
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Common migration only needs one channel, so we can start
|
|
|
|
+ * right now. Multifd needs more than one channel, we wait.
|
|
|
|
+ */
|
|
|
|
+ start_migration = !migrate_use_multifd();
|
|
|
|
+ } else {
|
|
|
|
+ /* Multiple connections */
|
|
|
|
+ assert(migrate_use_multifd());
|
|
|
|
+ start_migration = multifd_recv_new_channel(ioc);
|
|
}
|
|
}
|
|
|
|
|
|
- if (multifd_recv_new_channel(ioc)) {
|
|
|
|
|
|
+ if (start_migration) {
|
|
migration_incoming_process();
|
|
migration_incoming_process();
|
|
}
|
|
}
|
|
}
|
|
}
|