[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/15] migration: unbreak postcopy recovery
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 03/15] migration: unbreak postcopy recovery |
Date: |
Tue, 10 Jul 2018 16:30:04 +0100 |
From: Peter Xu <address@hidden>
The whole postcopy recovery logic was accidentally broken. We need to
fix it in two steps.
This is the first step that we should do the recovery when needed. It
was bypassed before after commit 36c2f8be2c.
Introduce postcopy_try_recovery() helper for the postcopy recovery
logic. Call it both in migration_fd_process_incoming() and
migration_ioc_process_incoming().
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/migration.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index aea6fb7444..eb3e09e899 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -466,7 +466,8 @@ void migration_incoming_process(void)
qemu_coroutine_enter(co);
}
-void migration_fd_process_incoming(QEMUFile *f)
+/* Returns true if recovered from a paused migration, otherwise false */
+static bool postcopy_try_recover(QEMUFile *f)
{
MigrationIncomingState *mis = migration_incoming_get_current();
@@ -491,11 +492,20 @@ void migration_fd_process_incoming(QEMUFile *f)
* that source is ready to reply to page requests.
*/
qemu_sem_post(&mis->postcopy_pause_sem_dst);
- } else {
- /* New incoming migration */
- migration_incoming_setup(f);
- migration_incoming_process();
+ return true;
+ }
+
+ return false;
+}
+
+void migration_fd_process_incoming(QEMUFile *f)
+{
+ if (postcopy_try_recover(f)) {
+ return;
}
+
+ migration_incoming_setup(f);
+ migration_incoming_process();
}
void migration_ioc_process_incoming(QIOChannel *ioc)
@@ -504,6 +514,9 @@ void migration_ioc_process_incoming(QIOChannel *ioc)
if (!mis->from_src_file) {
QEMUFile *f = qemu_fopen_channel_input(ioc);
+ if (postcopy_try_recover(f)) {
+ return;
+ }
migration_incoming_setup(f);
return;
}
--
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) <=
- [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), 2018/07/10
- [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