[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/21] migration/postcopy: postpone setting PostcopyState to END
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 14/21] migration/postcopy: postpone setting PostcopyState to END |
Date: |
Fri, 11 Oct 2019 20:16:39 +0100 |
From: Wei Yang <address@hidden>
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>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Fixed up in merge to the 1 parameter postcopy_state_set
---
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 3a72f7b4fe..a793bad477 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);
-
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 c62687afef..bf3da58ecc 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);
+
return NULL;
}
--
2.23.0
- [PULL 05/21] migration: Use automatic rcu_read unlock in rdma.c, (continued)
- [PULL 05/21] migration: Use automatic rcu_read unlock in rdma.c, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 08/21] migration/postcopy: allocate tmp_page in setup stage, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 04/21] migration: Use automatic rcu_read unlock in ram.c, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 06/21] rcu: Use automatic rc_read unlock in core memory/exec code, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 09/21] migration/postcopy: map large zero page in postcopy_ram_incoming_setup(), Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 07/21] migration: Don't try and recover return path in non-postcopy, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 11/21] migration: pass in_postcopy instead of check state again, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 10/21] migration/postcopy: fix typo in mark_postcopy_blocktime_begin's comment, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 12/21] migration: report SaveStateEntry id and name on failure, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 13/21] migration/postcopy: mis->have_listen_thread check will never be touched, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 14/21] migration/postcopy: postpone setting PostcopyState to END,
Dr. David Alan Gilbert (git) <=
- [PULL 15/21] migration/postcopy: rename postcopy_ram_enable_notify to postcopy_ram_incoming_setup, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 16/21] migration/postcopy: check PostcopyState before setting to POSTCOPY_INCOMING_RUNNING, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 17/21] migration/multifd: fix a typo in comment of multifd_recv_unfill_packet(), Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 18/21] migration/multifd: use pages->allocated instead of the static max, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 19/21] migration/multifd: initialize packet->magic/version once at setup stage, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 20/21] migration/multifd: pages->used would be cleared when attach to multifd_send_state, Dr. David Alan Gilbert (git), 2019/10/11
- [PULL 21/21] migration: Support gtree migration, Dr. David Alan Gilbert (git), 2019/10/11
- Re: [PULL 00/21] migration queue, Peter Maydell, 2019/10/14