From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com
Cc: jdenemar@redhat.com, liang.z.li@intel.com,
zhang.zhanghailiang@huawei.com
Subject: [Qemu-devel] [PATCH v2 3/6] Postcopy: Send events/change state on incoming side
Date: Wed, 16 Dec 2015 11:47:35 +0000 [thread overview]
Message-ID: <1450266458-3178-4-git-send-email-dgilbert@redhat.com> (raw)
In-Reply-To: <1450266458-3178-1-git-send-email-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
I missed the calls to send migration events on the destination side
as we enter postcopy.
Take care when adding them not to do it after state has been freed.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
migration/savevm.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 0ad1b93..c469bad 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1399,6 +1399,8 @@ static void *postcopy_ram_listen_thread(void *opaque)
MigrationIncomingState *mis = migration_incoming_get_current();
int load_res;
+ migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
+ MIGRATION_STATUS_POSTCOPY_ACTIVE);
qemu_sem_post(&mis->listen_thread_sem);
trace_postcopy_ram_listen_thread_start();
@@ -1415,6 +1417,8 @@ static void *postcopy_ram_listen_thread(void *opaque)
if (load_res < 0) {
error_report("%s: loadvm failed: %d", __func__, load_res);
qemu_file_set_error(f, load_res);
+ migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
+ MIGRATION_STATUS_FAILED);
} else {
/*
* This looks good, but it's possible that the device loading in the
@@ -1424,13 +1428,6 @@ static void *postcopy_ram_listen_thread(void *opaque)
qemu_event_wait(&mis->main_thread_load_event);
}
postcopy_ram_incoming_cleanup(mis);
- /*
- * If everything has worked fine, then the main thread has waited
- * for us to start, and we're the last use of the mis.
- * (If something broke then qemu will have to exit anyway since it's
- * got a bad migration state).
- */
- migration_incoming_state_destroy();
if (load_res < 0) {
/*
@@ -1442,6 +1439,17 @@ static void *postcopy_ram_listen_thread(void *opaque)
exit(EXIT_FAILURE);
}
+ migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
+ MIGRATION_STATUS_COMPLETED);
+ /*
+ * If everything has worked fine, then the main thread has waited
+ * for us to start, and we're the last use of the mis.
+ * (If something broke then qemu will have to exit anyway since it's
+ * got a bad migration state).
+ */
+ migration_incoming_state_destroy();
+
+
return NULL;
}
--
2.5.0
next prev parent reply other threads:[~2015-12-16 11:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 11:47 [Qemu-devel] [PATCH v2 0/6] Migration: Small fixes and improvements Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 1/6] migration: Export migrate_set_state() Dr. David Alan Gilbert (git)
2015-12-16 12:40 ` Juan Quintela
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 2/6] migration: Add state records for migration incoming Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` Dr. David Alan Gilbert (git) [this message]
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 4/6] Migration: Emit event at start of pass Dr. David Alan Gilbert (git)
2015-12-16 12:41 ` Juan Quintela
2015-12-16 16:47 ` Eric Blake
2015-12-16 16:52 ` Dr. David Alan Gilbert
2016-01-13 10:27 ` Amit Shah
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 5/6] Use qemu_get_buffer_in_place for xbzrle data Dr. David Alan Gilbert (git)
2015-12-16 11:47 ` [Qemu-devel] [PATCH v2 6/6] multithread decompression: Avoid one copy Dr. David Alan Gilbert (git)
2016-01-13 10:29 ` [Qemu-devel] [PATCH v2 0/6] Migration: Small fixes and improvements Amit Shah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450266458-3178-4-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=jdenemar@redhat.com \
--cc=liang.z.li@intel.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).