[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 44/47] postcopy: Wire up loadvm_postcopy_handle_
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v6 44/47] postcopy: Wire up loadvm_postcopy_handle_ commands |
Date: |
Tue, 14 Apr 2015 18:04:10 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Wire up more of the handlers for the commands on the destination side,
in particular loadvm_postcopy_handle_run now has enough to start the
guest running.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
savevm.c | 29 ++++++++++++++++++++++++++++-
trace-events | 2 ++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/savevm.c b/savevm.c
index ce8c3b5..a1fabb5 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1360,12 +1360,34 @@ static int
loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
static int loadvm_postcopy_handle_run(MigrationIncomingState *mis)
{
PostcopyState ps = postcopy_state_set(mis, POSTCOPY_INCOMING_RUNNING);
+ Error *local_err = NULL;
+
trace_loadvm_postcopy_handle_run();
if (ps != POSTCOPY_INCOMING_LISTENING) {
error_report("CMD_POSTCOPY_RUN in wrong postcopy state (%d)", ps);
return -1;
}
+ /* TODO we should move all of this lot into postcopy_ram.c or a shared code
+ * in migration.c
+ */
+ cpu_synchronize_all_post_init();
+
+ qemu_announce_self();
+
+ /* Make sure all file formats flush their mutable metadata */
+ bdrv_invalidate_cache_all(&local_err);
+ if (local_err) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ return -1;
+ }
+
+ trace_loadvm_postcopy_handle_run_cpu_sync();
+ cpu_synchronize_all_post_init();
+
+ trace_loadvm_postcopy_handle_run_vmstart();
+
if (autostart) {
/* Hold onto your hats, starting the CPU */
vm_start();
@@ -1374,7 +1396,12 @@ static int
loadvm_postcopy_handle_run(MigrationIncomingState *mis)
runstate_set(RUN_STATE_PAUSED);
}
- return 0;
+ /* We need to finish reading the stream from the package
+ * and also stop reading anything more from the stream that loaded the
+ * package (since it's now being read by the listener thread).
+ * LOADVM_QUIT will quit all the layers of nested loadvm loops.
+ */
+ return LOADVM_QUIT;
}
static int loadvm_process_command_simple_lencheck(const char *name,
diff --git a/trace-events b/trace-events
index 2f50cc4..1ab9079 100644
--- a/trace-events
+++ b/trace-events
@@ -1182,6 +1182,8 @@ loadvm_handle_cmd_packaged_received(int ret) "%d"
loadvm_postcopy_handle_advise(void) ""
loadvm_postcopy_handle_listen(void) ""
loadvm_postcopy_handle_run(void) ""
+loadvm_postcopy_handle_run_cpu_sync(void) ""
+loadvm_postcopy_handle_run_vmstart(void) ""
loadvm_postcopy_ram_handle_discard(void) ""
loadvm_postcopy_ram_handle_discard_end(void) ""
loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len)
"%s: %ud"
--
2.1.0
- [Qemu-devel] [PATCH v6 38/47] Postcopy: Use helpers to map pages during migration, (continued)
- [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), 2015/04/14
- [Qemu-devel] [PATCH v6 44/47] postcopy: Wire up loadvm_postcopy_handle_ commands,
Dr. David Alan Gilbert (git) <=
- [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