qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs
@ 2016-01-24 14:09 Wei Yang
  2016-01-24 14:09 ` [Qemu-trivial] [PATCH 2/2] qmp-spec: fix index in doc Wei Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wei Yang @ 2016-01-24 14:09 UTC (permalink / raw)
  To: qemu-trivial; +Cc: amit.shah, Wei Yang, quintela

Within the if statement, time_spent is assured to be non-zero.

This patch just removes the check on time_spent when calculating mbs.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index c842499..40b87f2 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1677,8 +1677,8 @@ static void *migration_thread(void *opaque)
             double bandwidth = (double)transferred_bytes / time_spent;
             max_size = bandwidth * migrate_max_downtime() / 1000000;
 
-            s->mbps = time_spent ? (((double) transferred_bytes * 8.0) /
-                    ((double) time_spent / 1000.0)) / 1000.0 / 1000.0 : -1;
+            s->mbps = (((double) transferred_bytes * 8.0) /
+                    ((double) time_spent / 1000.0)) / 1000.0 / 1000.0;
 
             trace_migrate_transferred(transferred_bytes, time_spent,
                                       bandwidth, max_size);
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-01 12:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-24 14:09 [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs Wei Yang
2016-01-24 14:09 ` [Qemu-trivial] [PATCH 2/2] qmp-spec: fix index in doc Wei Yang
2016-01-30  9:46   ` Michael Tokarev
2016-02-01 12:52     ` Wei Yang
2016-01-29 14:03 ` [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs Wei Yang
2016-01-29 14:37   ` Amit Shah
2016-01-30  9:45 ` Michael Tokarev
2016-02-01 12:54   ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).