[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 45/47] End of migration for postcopy
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v6 45/47] End of migration for postcopy |
Date: |
Tue, 14 Apr 2015 18:04:11 +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>
---
migration/migration.c | 25 ++++++++++++++++++++++++-
trace-events | 2 ++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 6537d23..180c8b0 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -160,12 +160,35 @@ 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);
ret = qemu_loadvm_state(f);
+ ps = postcopy_state_get(mis);
+ 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 1ab9079..1378992 100644
--- a/trace-events
+++ b/trace-events
@@ -1435,6 +1435,8 @@ 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
+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_dma_accept_incoming_migration(void) ""
--
2.1.0
- [Qemu-devel] [PATCH v6 34/47] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command, (continued)
- [Qemu-devel] [PATCH v6 34/47] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 38/47] Postcopy: Use helpers to map pages during migration, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 40/47] Don't sync dirty bitmaps in postcopy, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 39/47] qemu_ram_block_from_host, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 37/47] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 41/47] Host page!=target page: Cleanup bitmaps, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 43/47] Start up a postcopy/listener thread ready for incoming page data, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 31/47] postcopy: ram_enable_notify to switch on userfault, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 42/47] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 46/47] Disable mlock around incoming postcopy, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 45/47] End of migration for postcopy,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v6 44/47] postcopy: Wire up loadvm_postcopy_handle_ commands, Dr. David Alan Gilbert (git), 2015/04/14
- [Qemu-devel] [PATCH v6 47/47] Inhibit ballooning during postcopy, Dr. David Alan Gilbert (git), 2015/04/14
- Re: [Qemu-devel] [PATCH v6 00/47] Postcopy implementation, Li, Liang Z, 2015/04/27