]> git.proxmox.com Git - mirror_qemu.git/commitdiff
rdma: remove check on time_spent when calculating mbs
authorWei Yang <richard.weiyang@gmail.com>
Sun, 24 Jan 2016 14:09:57 +0000 (14:09 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 11 Feb 2016 12:15:46 +0000 (15:15 +0300)
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>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
migration/migration.c

index 82604d240e65b3f75c9269e3bb78ac81829d136b..a64cfcdb07d074c083b70748278d6f7716b37c14 100644 (file)
@@ -1691,8 +1691,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);