Patchwork [4/5] stream: fix ratelimit_set_speed

login
register
mail settings
Submitter Kevin Wolf
Date Nov. 30, 2012, 1:02 p.m.
Message ID <1354280549-5954-5-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/202961/
State New
Headers show

Comments

Kevin Wolf - Nov. 30, 2012, 1:02 p.m.
From: Dietmar Maurer <dietmar@proxmox.com>

The formula to compute slice_quota was wrong since commit 6ef228fc.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/qemu/ratelimit.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h
index c6ac281..d1610f1 100644
--- a/include/qemu/ratelimit.h
+++ b/include/qemu/ratelimit.h
@@ -42,7 +42,7 @@  static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed,
                                        uint64_t slice_ns)
 {
     limit->slice_ns = slice_ns;
-    limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns;
+    limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL;
 }
 
 #endif