aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-12-02 11:29:38 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 11:45:49 -0600
commit843079386eed4ae2dbe1be98383f185b7721411b (patch)
tree3c3820ee70fa961bc2d6af6f6d76af6603dec15a /vl.c
parentb09417b9bcbde787a03cf38608cb897a52f12dd5 (diff)
ram migration: Properly reset statistics
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index e9b75c9b86..78a4ec4d90 100644
--- a/vl.c
+++ b/vl.c
@@ -2897,7 +2897,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)
{
@@ -2945,6 +2945,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))