[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 47/47] End of migration for postcopy
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v4 47/47] End of migration for postcopy |
Date: |
Fri, 3 Oct 2014 18:47:53 +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.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/migration.c b/migration.c
index f0f2e2f..1ee5b1b 100644
--- a/migration.c
+++ b/migration.c
@@ -205,12 +205,33 @@ static void process_incoming_migration_co(void *opaque)
{
QEMUFile *f = opaque;
Error *local_err = NULL;
+ MigrationIncomingState *mis;
int ret;
- migration_incoming_state_init(f);
+ mis = migration_incoming_state_init(f);
ret = qemu_loadvm_state(f);
+ DPRINTF("%s: ret=%d postcopy_ram_state=%d", __func__, ret,
+ mis->postcopy_ram_state);
+ if (mis->postcopy_ram_state == POSTCOPY_RAM_INCOMING_ADVISE) {
+ /*
+ * Where a migration had postcopy enabled (and thus went to advise)
+ * but managed to complete within the precopy period
+ */
+ postcopy_ram_incoming_cleanup(mis);
+ } else {
+ if ((ret >= 0) &&
+ (mis->postcopy_ram_state > POSTCOPY_RAM_INCOMING_ADVISE)) {
+ /*
+ * Postcopy was started, cleanup should happen at the end of the
+ * postcopy thread.
+ */
+ DPRINTF("process_incoming_migration_co: exiting main branch");
+ return;
+ }
+ }
+
qemu_fclose(f);
free_xbzrle_decoded_buf();
migration_incoming_state_destroy();
--
1.9.3
- Re: [Qemu-devel] [PATCH v4 38/47] Add assertion to check migration_dirty_pages, (continued)
- [Qemu-devel] [PATCH v4 40/47] Postcopy: Use helpers to map pages during migration, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 41/47] qemu_ram_block_from_host, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 42/47] Don't sync dirty bitmaps in postcopy, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 43/47] Host page!=target page: Cleanup bitmaps, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 44/47] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 45/47] Start up a postcopy/listener thread ready for incoming page data, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 46/47] postcopy: Wire up loadvm_postcopy_ram_handle_{run, end} commands, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 47/47] End of migration for postcopy,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v4 34/47] Postcopy: Create a fault handler thread before marking the ram as userfault, Dr. David Alan Gilbert (git), 2014/10/03
- [Qemu-devel] [PATCH v4 39/47] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2014/10/03
- Re: [Qemu-devel] [PATCH v4 00/47] Postcopy implementation, Dr. David Alan Gilbert, 2014/10/03