[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] migration/postcopy: postpone setting PostcopyState to EN
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 2/3] migration/postcopy: postpone setting PostcopyState to END |
Date: |
Tue, 8 Oct 2019 20:06:04 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
* Wei Yang (address@hidden) wrote:
> There are two places to call function postcopy_ram_incoming_cleanup()
>
> postcopy_ram_listen_thread on migration success
> loadvm_postcopy_handle_listen one setup failure
>
> On success, the vm will never accept another migration. On failure,
> PostcopyState is transited from LISTENING to END and would be checked in
> qemu_loadvm_state_main(). If PostcopyState is RUNNING, migration would
> be paused and retried.
>
> Currently PostcopyState is set to END in function
> postcopy_ram_incoming_cleanup(). With above analysis, we can take this
> step out and postpone this till the end of listen thread to indicate the
> listen thread is done.
>
> This is a preparation patch for later cleanup.
>
> Signed-off-by: Wei Yang <address@hidden>
Yes, I think that's OK - I couldn't see anywhere that's currently
checking the state in between.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> ---
> migration/postcopy-ram.c | 2 --
> migration/savevm.c | 2 ++
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index a394c7c3a6..5da6de8c8b 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -577,8 +577,6 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState
> *mis)
> }
> }
>
> - postcopy_state_set(POSTCOPY_INCOMING_END, NULL);
> -
> if (mis->postcopy_tmp_page) {
> munmap(mis->postcopy_tmp_page, mis->largest_page_size);
> mis->postcopy_tmp_page = NULL;
> diff --git a/migration/savevm.c b/migration/savevm.c
> index eaa4cf58ef..dcad8897a3 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1837,6 +1837,8 @@ static void *postcopy_ram_listen_thread(void *opaque)
>
> rcu_unregister_thread();
> mis->have_listen_thread = false;
> + postcopy_state_set(POSTCOPY_INCOMING_END, NULL);
> +
> return NULL;
> }
>
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
Re: [PATCH 0/3] migration/postcopy: replace have_listen_thread check with PostcopyState check, Dr. David Alan Gilbert, 2019/10/11