From: Dietmar Maurer Date: Wed, 24 Oct 2012 10:10:47 +0000 (+0200) Subject: stream: fix ratelimit_set_speed X-Git-Tag: qemu-xen-4.3.0-rc1~17^2~4^2~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e3980e28bb888bf643054770452998d1b4319609;p=qemu-upstream-4.3-testing.git stream: fix ratelimit_set_speed The formula to compute slice_quota was wrong since commit 6ef228fc. Signed-off-by: Dietmar Maurer Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h index c6ac28114..d1610f135 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