[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/20] migration: Allow migrate-recover to run multiple times
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 15/20] migration: Allow migrate-recover to run multiple times |
Date: |
Mon, 21 Feb 2022 17:03:24 +0000 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
* Peter Xu (peterx@redhat.com) wrote:
> 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.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
OK, was that the only reason you couldn't recover twice?
Reviewed-by: Dr. David Alan Gilbert <dgilbert@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
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- Re: [PATCH 11/20] migration: postcopy_pause_fault_thread() never fails, (continued)
- [PATCH 14/20] migration: Add migration_incoming_transport_cleanup(), Peter Xu, 2022/02/16
- [PATCH 15/20] migration: Allow migrate-recover to run multiple times, Peter Xu, 2022/02/16
- Re: [PATCH 15/20] migration: Allow migrate-recover to run multiple times,
Dr. David Alan Gilbert <=
- [PATCH 16/20] migration: Add postcopy-preempt capability, Peter Xu, 2022/02/16
- [PATCH 17/20] migration: Postcopy preemption preparation on channel creation, Peter Xu, 2022/02/16
[PATCH 18/20] migration: Postcopy preemption enablement, Peter Xu, 2022/02/16