Message ID | 79f1daa9190b15d4878f86289ed44d630272d851.1290552026.git.quintela@redhat.com |
---|---|
State | New |
Headers | show |
On 11/23/2010 05:03 PM, Juan Quintela wrote: > From: Juan Quintela<quintela@trasno.org> > > Signed-off-by: Juan Quintela<quintela@trasno.org> > Signed-off-by: Juan Quintela<quintela@redhat.com> > Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Regards, Anthony Liguori > --- > 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, >
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,