[PATCH v3 31/35] arch_init: export ram_save_iterate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 arch_init.c |   11 ++++++++---
 arch_init.h |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index f86a0b4..48f45cd 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -633,7 +633,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     return 0;
 }
 
-static int ram_save_iterate(QEMUFile *f, void *opaque)
+int ram_save_iterate(QEMUFile *f)
 {
     uint64_t bytes_transferred_last;
     double bwidth = 0;
@@ -705,6 +705,11 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
     return 0;
 }
 
+static int ram_save_iterate_bwidth(QEMUFile *f, void *opaque)
+{
+    return ram_save_iterate(f);
+}
+
 static int ram_save_complete(QEMUFile *f, void *opaque)
 {
     migration_bitmap_sync();
@@ -937,7 +942,7 @@ static void ram_save_set_params(const MigrationParams *params, void *opaque)
         savevm_ram_handlers.save_live_complete =
             postcopy_outgoing_ram_save_complete;
     } else {
-        savevm_ram_handlers.save_live_iterate = ram_save_iterate;
+        savevm_ram_handlers.save_live_iterate = ram_save_iterate_bwidth;
         savevm_ram_handlers.save_live_complete = ram_save_complete;
     }
 }
@@ -945,7 +950,7 @@ static void ram_save_set_params(const MigrationParams *params, void *opaque)
 SaveVMHandlers savevm_ram_handlers = {
     .set_params = ram_save_set_params,
     .save_live_setup = ram_save_setup,
-    .save_live_iterate = ram_save_iterate,
+    .save_live_iterate = ram_save_iterate_bwidth,
     .save_live_complete = ram_save_complete,
     .load_state = ram_load_precopy,
     .cancel = ram_migration_cancel,
diff --git a/arch_init.h b/arch_init.h
index 3977ca7..966b25a 100644
--- a/arch_init.h
+++ b/arch_init.h
@@ -47,6 +47,7 @@ CpuDefinitionInfoList GCC_WEAK_DECL *arch_query_cpu_definitions(Error **errp);
 #define RAM_SAVE_VERSION_ID     4 /* currently version 4 */
 
 int ram_load_page(QEMUFile *f, void *host, int flags);
+int ram_save_iterate(QEMUFile *f);
 
 #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY)
 void ram_save_set_last_block(RAMBlock *block, ram_addr_t offset);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux