From: Wei Yang <richard.weiyang@gmail.com>
To: qemu-trivial@nongnu.org
Cc: amit.shah@redhat.com, Wei Yang <richard.weiyang@gmail.com>,
quintela@redhat.com
Subject: [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs
Date: Sun, 24 Jan 2016 14:09:57 +0000 [thread overview]
Message-ID: <1453644598-11250-1-git-send-email-richard.weiyang@gmail.com> (raw)
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
next reply other threads:[~2016-01-25 7:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-24 14:09 Wei Yang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453644598-11250-1-git-send-email-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=amit.shah@redhat.com \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).