[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 52/56] postcopy: Wire up loadvm_postcopy_handle_
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v9 52/56] postcopy: Wire up loadvm_postcopy_handle_ commands |
Date: |
Thu, 5 Nov 2015 18:11:19 +0000 |
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>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
---
migration/savevm.c | 28 +++++++++++++++++++++++++++-
trace-events | 2 ++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 51c3fb1..be42b06 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1479,12 +1479,33 @@ static int
loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
static int loadvm_postcopy_handle_run(MigrationIncomingState *mis)
{
PostcopyState ps = postcopy_state_set(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) {
+ error_report_err(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();
@@ -1493,7 +1514,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;
}
/**
diff --git a/trace-events b/trace-events
index 1130292..a89778f 100644
--- a/trace-events
+++ b/trace-events
@@ -1215,6 +1215,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.5.0
- Re: [Qemu-devel] [PATCH v9 44/56] Postcopy: Use helpers to map pages during migration, (continued)
- [Qemu-devel] [PATCH v9 43/56] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 45/56] postcopy: Check order of received target pages, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 46/56] Don't sync dirty bitmaps in postcopy, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 47/56] Don't iterate on precopy-only devices during postcopy, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 48/56] Host page!=target page: Cleanup bitmaps, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 49/56] Round up RAMBlock sizes to host page sizes, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 50/56] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 51/56] Start up a postcopy/listener thread ready for incoming page data, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 52/56] postcopy: Wire up loadvm_postcopy_handle_ commands,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PATCH v9 53/56] Postcopy: Mark nohugepage before discard, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 54/56] End of migration for postcopy, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 55/56] Disable mlock around incoming postcopy, Dr. David Alan Gilbert (git), 2015/11/05
- [Qemu-devel] [PATCH v9 56/56] Inhibit ballooning during postcopy, Dr. David Alan Gilbert (git), 2015/11/05
- Re: [Qemu-devel] [PATCH v9 00/56] Postcopy implementation, Bharata B Rao, 2015/11/05