qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 06/10] Only calculate expected_time for stage 2


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 06/10] Only calculate expected_time for stage 2
Date: Wed, 24 Nov 2010 00:03:03 +0100

From: Juan Quintela <address@hidden>

Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
 arch_init.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 4486925..df3d91f 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -217,7 +217,6 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, 
void *opaque)
     ram_addr_t addr;
     uint64_t bytes_transferred_last;
     double bwidth = 0;
-    uint64_t expected_time = 0;

     if (stage < 0) {
         cpu_physical_memory_set_dirty_tracking(0);
@@ -293,9 +292,12 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, 
void *opaque)

     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);

-    expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
-
-    return (stage == 2) && (expected_time <= migrate_max_downtime());
+    if (stage == 2) {
+           uint64_t expected_time;
+           expected_time = ram_save_remaining() * TARGET_PAGE_SIZE / bwidth;
+           return expected_time <= migrate_max_downtime();
+    }
+    return 0;
 }

 static inline void *host_from_stream_offset(QEMUFile *f,
-- 
1.7.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]