[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10] Count nanoseconds with uint64_t not doubles
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 08/10] Count nanoseconds with uint64_t not doubles |
Date: |
Wed, 24 Nov 2010 00:03:05 +0100 |
From: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
arch_init.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 9e941a0..d32aaae 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -216,6 +216,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage,
void *opaque)
{
ram_addr_t addr;
uint64_t bytes_transferred_last;
+ uint64_t t0;
double bwidth = 0;
if (stage < 0) {
@@ -258,7 +259,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage,
void *opaque)
}
bytes_transferred_last = bytes_transferred;
- bwidth = qemu_get_clock_ns(rt_clock);
+ t0 = qemu_get_clock_ns(rt_clock);
while (!qemu_file_rate_limit(f)) {
int bytes_sent;
@@ -270,8 +271,8 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage,
void *opaque)
}
}
- bwidth = qemu_get_clock_ns(rt_clock) - bwidth;
- bwidth = (bytes_transferred - bytes_transferred_last) / bwidth;
+ t0 = qemu_get_clock_ns(rt_clock) - t0;
+ bwidth = (bytes_transferred - bytes_transferred_last) / t0;
/* if we haven't transferred anything this round, force expected_time to a
* a very high value, but without crashing */
--
1.7.3.2
[Qemu-devel] [PATCH 08/10] Count nanoseconds with uint64_t not doubles,
Juan Quintela <=
[Qemu-devel] [PATCH 09/10] Exit loop if we have been there too long, Juan Quintela, 2010/11/23
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Michael S. Tsirkin, 2010/11/24
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Juan Quintela, 2010/11/24
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Michael S. Tsirkin, 2010/11/24
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Paolo Bonzini, 2010/11/24
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Michael S. Tsirkin, 2010/11/24
- Message not available
- [Qemu-devel] Re: [PATCH 09/10] Exit loop if we have been there too long, Juan Quintela, 2010/11/30
Message not available