diff options
author | Juan Quintela <quintela@redhat.com> | 2012-06-28 19:48:09 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2012-07-20 08:19:27 +0200 |
commit | b81e712d252cf41a0825f5abad0ce2f4746864f1 (patch) | |
tree | 783c15ad562684563538ef924e583c5414752fb1 /arch_init.c | |
parent | 5910d1e6cbb190809d5dd0d75bb5e8398dd3ffb7 (diff) |
ram: save_live_complete() only do one loop
We were doing the same loop that stage2, and a new one for stage3. We
only need the one for stage3.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r-- | arch_init.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch_init.c b/arch_init.c index 2a6fc77a8e..3c38a52168 100644 --- a/arch_init.c +++ b/arch_init.c @@ -403,42 +403,10 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) static int ram_save_complete(QEMUFile *f, void *opaque) { - double bwidth = 0; - int ret; - int i; int bytes_sent; memory_global_sync_dirty_bitmap(get_system_memory()); - bwidth = qemu_get_clock_ns(rt_clock); - - i = 0; - while ((ret = qemu_file_rate_limit(f)) == 0) { - bytes_sent = ram_save_block(f); - bytes_transferred += bytes_sent; - if (bytes_sent == 0) { /* no more blocks */ - break; - } - /* we want to check in the 1st loop, just in case it was the 1st time - and we had to sync the dirty bitmap. - qemu_get_clock_ns() is a bit expensive, so we only check each some - iterations - */ - if ((i & 63) == 0) { - uint64_t t1 = (qemu_get_clock_ns(rt_clock) - bwidth) / 1000000; - if (t1 > MAX_WAIT) { - DPRINTF("big wait: " PRIu64 " milliseconds, %d iterations\n", - t1, i); - break; - } - } - i++; - } - - if (ret < 0) { - return ret; - } - /* try transferring iterative blocks of memory */ /* flush all remaining blocks regardless of rate limiting */ |