[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/15] migration: unify incoming processing
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 04/15] migration: unify incoming processing |
Date: |
Tue, 10 Jul 2018 16:30:05 +0100 |
From: Peter Xu <address@hidden>
This is the 2nd patch to unbreak postcopy recovery.
Let's unify the migration_incoming_process() call at a single place
rather than calling it in connection setup codes. This fixes a problem
that we will go into incoming migration procedure even if we are trying
to recovery from a paused postcopy migration.
Fixes: 36c2f8be2c ("migration: Delay start of migration main routines")
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/exec.c | 3 ---
migration/fd.c | 3 ---
migration/migration.c | 18 ++++++++++++++++--
migration/socket.c | 5 -----
4 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/migration/exec.c b/migration/exec.c
index 0bbeb63c97..375d2e1b54 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -49,9 +49,6 @@ static gboolean exec_accept_incoming_migration(QIOChannel
*ioc,
{
migration_channel_process_incoming(ioc);
object_unref(OBJECT(ioc));
- if (!migrate_use_multifd()) {
- migration_incoming_process();
- }
return G_SOURCE_REMOVE;
}
diff --git a/migration/fd.c b/migration/fd.c
index fee34ffdc0..a7c13df4ad 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -49,9 +49,6 @@ static gboolean fd_accept_incoming_migration(QIOChannel *ioc,
{
migration_channel_process_incoming(ioc);
object_unref(OBJECT(ioc));
- if (!migrate_use_multifd()) {
- migration_incoming_process();
- }
return G_SOURCE_REMOVE;
}
diff --git a/migration/migration.c b/migration/migration.c
index eb3e09e899..0404c53215 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -511,17 +511,31 @@ void migration_fd_process_incoming(QEMUFile *f)
void migration_ioc_process_incoming(QIOChannel *ioc)
{
MigrationIncomingState *mis = migration_incoming_get_current();
+ bool start_migration;
if (!mis->from_src_file) {
+ /* The first connection (multifd may have multiple) */
QEMUFile *f = qemu_fopen_channel_input(ioc);
+
+ /* If it's a recovery, we're done */
if (postcopy_try_recover(f)) {
return;
}
+
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();
}
}
diff --git a/migration/socket.c b/migration/socket.c
index 3456eb76e9..f4c8174400 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -168,12 +168,7 @@ static void
socket_accept_incoming_migration(QIONetListener *listener,
if (migration_has_all_channels()) {
/* Close listening socket as its no longer needed */
qio_net_listener_disconnect(listener);
-
object_unref(OBJECT(listener));
-
- if (!migrate_use_multifd()) {
- migration_incoming_process();
- }
}
}
--
2.17.1
- [Qemu-devel] [PULL 00/15] migration queue, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 03/15] migration: unbreak postcopy recovery, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 01/15] migration: delay postcopy paused state, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 04/15] migration: unify incoming processing,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 02/15] migration: move income process out of multifd, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 05/15] migration: simplify check to use qemu file buffer, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 06/15] migration: loosen recovery check when load vm, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 07/15] migration: fix incorrect bitmap size calculation, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 08/15] migration: show pause/recover state on dst host, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 09/15] tests: introduce migrate_postcopy_* helpers, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 11/15] tests: introduce migrate_query*() helpers, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 12/15] tests: introduce wait_for_migration_status(), Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 10/15] tests: allow migrate() to take extra flags, Dr. David Alan Gilbert (git), 2018/07/10
- [Qemu-devel] [PULL 13/15] tests: add postcopy recovery test, Dr. David Alan Gilbert (git), 2018/07/10