[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 54/57] End of migration for postcopy
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 54/57] End of migration for postcopy |
Date: |
Tue, 10 Nov 2015 15:25:43 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Tweak the end of migration cleanup; we don't want to close stuff down
at the end of the main stream, since the postcopy is still sending pages
on the other thread.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/migration.c | 26 +++++++++++++++++++++++++-
trace-events | 6 ++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index db3d2dd..c5c977e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -325,13 +325,37 @@ static void process_incoming_migration_co(void *opaque)
{
QEMUFile *f = opaque;
Error *local_err = NULL;
+ MigrationIncomingState *mis;
+ PostcopyState ps;
int ret;
- migration_incoming_state_new(f);
+ mis = migration_incoming_state_new(f);
postcopy_state_set(POSTCOPY_INCOMING_NONE);
migrate_generate_event(MIGRATION_STATUS_ACTIVE);
+
ret = qemu_loadvm_state(f);
+ ps = postcopy_state_get();
+ trace_process_incoming_migration_co_end(ret, ps);
+ if (ps != POSTCOPY_INCOMING_NONE) {
+ if (ps == POSTCOPY_INCOMING_ADVISE) {
+ /*
+ * Where a migration had postcopy enabled (and thus went to advise)
+ * but managed to complete within the precopy period, we can use
+ * the normal exit.
+ */
+ postcopy_ram_incoming_cleanup(mis);
+ } else if (ret >= 0) {
+ /*
+ * Postcopy was started, cleanup should happen at the end of the
+ * postcopy thread.
+ */
+ trace_process_incoming_migration_co_postcopy_end_main();
+ return;
+ }
+ /* Else if something went wrong then just fall out of the normal exit
*/
+ }
+
qemu_fclose(f);
free_xbzrle_decoded_buf();
migration_incoming_state_destroy();
diff --git a/trace-events b/trace-events
index 452435d..ef6bc41 100644
--- a/trace-events
+++ b/trace-events
@@ -1480,11 +1480,13 @@ source_return_path_thread_entry(void) ""
source_return_path_thread_loop_top(void) ""
source_return_path_thread_pong(uint32_t val) "%x"
source_return_path_thread_shut(uint32_t val) "%x"
-migrate_transferred(uint64_t tranferred, uint64_t time_spent, double
bandwidth, uint64_t size) "transferred %" PRIu64 " time_spent %" PRIu64 "
bandwidth %g max_size %" PRId64
-migrate_state_too_big(void) ""
migrate_global_state_post_load(const char *state) "loaded state: %s"
migrate_global_state_pre_save(const char *state) "saved state: %s"
migration_thread_low_pending(uint64_t pending) "%" PRIu64
+migrate_state_too_big(void) ""
+migrate_transferred(uint64_t tranferred, uint64_t time_spent, double
bandwidth, uint64_t size) "transferred %" PRIu64 " time_spent %" PRIu64 "
bandwidth %g max_size %" PRId64
+process_incoming_migration_co_end(int ret, int ps) "ret=%d postcopy-state=%d"
+process_incoming_migration_co_postcopy_end_main(void) ""
# migration/rdma.c
qemu_rdma_accept_incoming_migration(void) ""
--
2.5.0
- [Qemu-devel] [PULL 43/57] postcopy_ram.c: place_page and helpers, (continued)
- [Qemu-devel] [PULL 43/57] postcopy_ram.c: place_page and helpers, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 45/57] postcopy: Check order of received target pages, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 46/57] Don't sync dirty bitmaps in postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 51/57] Start up a postcopy/listener thread ready for incoming page data, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 50/57] Postcopy; Handle userfault requests, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 49/57] Round up RAMBlock sizes to host page sizes, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 52/57] postcopy: Wire up loadvm_postcopy_handle_ commands, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 47/57] Don't iterate on precopy-only devices during postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 48/57] Host page!=target page: Cleanup bitmaps, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 55/57] Disable mlock around incoming postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 54/57] End of migration for postcopy,
Juan Quintela <=
- [Qemu-devel] [PULL 53/57] Postcopy: Mark nohugepage before discard, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 56/57] Inhibit ballooning during postcopy, Juan Quintela, 2015/11/10
- [Qemu-devel] [PULL 57/57] migration: qemu_savevm_state_cleanup becomes mandatory operation, Juan Quintela, 2015/11/10
- Re: [Qemu-devel] [PULL 00/57] Migration pull (take 2), Peter Maydell, 2015/11/10