Patchwork [3/4] arch_init: calculate transferred bytes at ram_load().

login
register
mail settings
Submitter Yoshiaki Tamura
Date June 1, 2010, 3:40 p.m.
Message ID <1275406821-30024-4-git-send-email-tamura.yoshiaki@lab.ntt.co.jp>
Download mbox | patch
Permalink /patch/54227/
State New
Headers show

Comments

Yoshiaki Tamura - June 1, 2010, 3:40 p.m.
Currently incoming side of migration doesn't know how many bytes are
transferred.  To print "info migrate" on incoming side, we need to
calculate transferred bytes at ram_load().

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
---
 arch_init.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/arch_init.c b/arch_init.c
index cfc03ea..1b4312d 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -277,6 +277,8 @@  int ram_load(QEMUFile *f, void *opaque, int version_id)
         if (qemu_file_has_error(f)) {
             return -EIO;
         }
+
+        bytes_transferred += TARGET_PAGE_SIZE;
     } while (!(flags & RAM_SAVE_FLAG_EOS));
 
     return 0;