[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 15/25] migration: Allow migrate-recover to run multiple times
From: |
Peter Xu |
Subject: |
[PATCH v2 15/25] migration: Allow migrate-recover to run multiple times |
Date: |
Tue, 1 Mar 2022 16:39:15 +0800 |
Previously migration didn't have an easy way to cleanup the listening
transport, migrate recovery only allows to execute once. That's done with a
trick flag in postcopy_recover_triggered.
Now the facility is already there.
Drop postcopy_recover_triggered and instead allows a new migrate-recover to
release the previous listener transport.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/migration.c | 13 ++-----------
migration/migration.h | 1 -
migration/savevm.c | 3 ---
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 6bb321cdd3..16086897aa 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2159,11 +2159,8 @@ void qmp_migrate_recover(const char *uri, Error **errp)
return;
}
- if (qatomic_cmpxchg(&mis->postcopy_recover_triggered,
- false, true) == true) {
- error_setg(errp, "Migrate recovery is triggered already");
- return;
- }
+ /* If there's an existing transport, release it */
+ migration_incoming_transport_cleanup(mis);
/*
* Note that this call will never start a real migration; it will
@@ -2171,12 +2168,6 @@ void qmp_migrate_recover(const char *uri, Error **errp)
* to continue using that newly established channel.
*/
qemu_start_incoming_migration(uri, errp);
-
- /* Safe to dereference with the assert above */
- if (*errp) {
- /* Reset the flag so user could still retry */
- qatomic_set(&mis->postcopy_recover_triggered, false);
- }
}
void qmp_migrate_pause(Error **errp)
diff --git a/migration/migration.h b/migration/migration.h
index f17ccc657c..a863032b71 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -139,7 +139,6 @@ struct MigrationIncomingState {
struct PostcopyBlocktimeContext *blocktime_ctx;
/* notify PAUSED postcopy incoming migrations to try to continue */
- bool postcopy_recover_triggered;
QemuSemaphore postcopy_pause_sem_dst;
QemuSemaphore postcopy_pause_sem_fault;
diff --git a/migration/savevm.c b/migration/savevm.c
index 967ff80547..254aa78234 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2589,9 +2589,6 @@ static bool
postcopy_pause_incoming(MigrationIncomingState *mis)
assert(migrate_postcopy_ram());
- /* Clear the triggered bit to allow one recovery */
- mis->postcopy_recover_triggered = false;
-
/*
* Unregister yank with either from/to src would work, since ioc behind it
* is the same
--
2.32.0
- [PATCH v2 03/25] migration: Tracepoint change in postcopy-run bottom half, (continued)
- [PATCH v2 03/25] migration: Tracepoint change in postcopy-run bottom half, Peter Xu, 2022/03/01
- [PATCH v2 04/25] migration: Introduce postcopy channels on dest node, Peter Xu, 2022/03/01
- [PATCH v2 05/25] migration: Dump ramblock and offset too when non-same-page detected, Peter Xu, 2022/03/01
- [PATCH v2 06/25] migration: Add postcopy_thread_create(), Peter Xu, 2022/03/01
- [PATCH v2 07/25] migration: Move static var in ram_block_from_stream() into global, Peter Xu, 2022/03/01
- [PATCH v2 08/25] migration: Add pss.postcopy_requested status, Peter Xu, 2022/03/01
- [PATCH v2 09/25] migration: Move migrate_allow_multifd and helpers into migration.c, Peter Xu, 2022/03/01
- [PATCH v2 10/25] migration: Enlarge postcopy recovery to capture !-EIO too, Peter Xu, 2022/03/01
- [PATCH v2 11/25] migration: postcopy_pause_fault_thread() never fails, Peter Xu, 2022/03/01
- [PATCH v2 14/25] migration: Add migration_incoming_transport_cleanup(), Peter Xu, 2022/03/01
- [PATCH v2 15/25] migration: Allow migrate-recover to run multiple times,
Peter Xu <=
- [PATCH v2 13/25] migration: Move channel setup out of postcopy_try_recover(), Peter Xu, 2022/03/01
- [PATCH v2 16/25] migration: Add postcopy-preempt capability, Peter Xu, 2022/03/01
- [PATCH v2 17/25] migration: Postcopy preemption preparation on channel creation, Peter Xu, 2022/03/01
- [PATCH v2 18/25] migration: Postcopy preemption enablement, Peter Xu, 2022/03/01
- [PATCH v2 19/25] migration: Postcopy recover with preempt enabled, Peter Xu, 2022/03/01
- [PATCH v2 12/25] migration: Export ram_load_postcopy(), Peter Xu, 2022/03/01
- [PATCH v2 21/25] migration: Parameter x-postcopy-preempt-break-huge, Peter Xu, 2022/03/01
- [PATCH v2 22/25] migration: Add helpers to detect TLS capability, Peter Xu, 2022/03/01
- [PATCH v2 23/25] migration: Fail postcopy preempt with TLS for now, Peter Xu, 2022/03/01
- [PATCH v2 20/25] migration: Create the postcopy preempt channel asynchronously, Peter Xu, 2022/03/01