Patchwork ram migration: Properly reset statistics

login
register
mail settings
Submitter Jan Kiszka
Date Dec. 2, 2009, 10:29 a.m.
Message ID <4B164192.9090400@siemens.com>
Download mbox | patch
Permalink /patch/39980/
State New
Headers show

Comments

Jan Kiszka - Dec. 2, 2009, 10:29 a.m.
As we may do more than one migration (cancellation, live backup), reset
bytes_transferred on stage 1.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 vl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index dbf1180..dc62c68 100644
--- a/vl.c
+++ b/vl.c
@@ -2896,7 +2896,7 @@  static int ram_save_block(QEMUFile *f)
     return found;
 }
 
-static uint64_t bytes_transferred = 0;
+static uint64_t bytes_transferred;
 
 static ram_addr_t ram_save_remaining(void)
 {
@@ -2944,6 +2944,8 @@  static int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
     }
 
     if (stage == 1) {
+        bytes_transferred = 0;
+
         /* Make sure all dirty bits are set */
         for (addr = 0; addr < last_ram_offset; addr += TARGET_PAGE_SIZE) {
             if (!cpu_physical_memory_get_dirty(addr, MIGRATION_DIRTY_FLAG))