summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-05-21 17:38:01 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:29 -0500
commit9f9e28cda74bc8cddd8ac4c0a9c007b31d42c6f6 (patch)
tree87790daf978b77e5f000e43d34d564a74df26cf9 /vl.c
parented8b330bccabb03c930ed1e4d72e341130f9b406 (diff)
downloadhqemu-9f9e28cda74bc8cddd8ac4c0a9c007b31d42c6f6.zip
hqemu-9f9e28cda74bc8cddd8ac4c0a9c007b31d42c6f6.tar.gz
augment info migrate with page status
This patch augments info migrate output with status about: * ram bytes remaining * ram bytes transferred * ram bytes total This should be enough for management tools to realize whether or not there is progress in migration. We can add more information later on, if the need arrives [v2: fixes bytes_transferred type] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index a24692c..5dfeb46 100644
--- a/vl.c
+++ b/vl.c
@@ -3234,6 +3234,7 @@ static int ram_save_block(QEMUFile *f)
}
static ram_addr_t ram_save_threshold = 10;
+static uint64_t bytes_transferred = 0;
static ram_addr_t ram_save_remaining(void)
{
@@ -3248,6 +3249,21 @@ static ram_addr_t ram_save_remaining(void)
return count;
}
+uint64_t ram_bytes_remaining(void)
+{
+ return ram_save_remaining() * TARGET_PAGE_SIZE;
+}
+
+uint64_t ram_bytes_transferred(void)
+{
+ return bytes_transferred;
+}
+
+uint64_t ram_bytes_total(void)
+{
+ return last_ram_offset;
+}
+
static int ram_save_live(QEMUFile *f, int stage, void *opaque)
{
ram_addr_t addr;
@@ -3269,6 +3285,7 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
int ret;
ret = ram_save_block(f);
+ bytes_transferred += ret * TARGET_PAGE_SIZE;
if (ret == 0) /* no more blocks */
break;
}
@@ -3278,7 +3295,9 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
if (stage == 3) {
/* flush all remaining blocks regardless of rate limiting */
- while (ram_save_block(f) != 0);
+ while (ram_save_block(f) != 0) {
+ bytes_transferred += TARGET_PAGE_SIZE;
+ }
cpu_physical_memory_set_dirty_tracking(0);
}
OpenPOWER on IntegriCloud