From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQyWe-0004U6-B9 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 06:49:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQyWY-0007Pb-Ix for qemu-devel@nongnu.org; Wed, 24 Oct 2012 06:49:28 -0400 Received: from www.maurer-it.com ([213.129.239.114]:48890 helo=maui.maurer-it.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQyWY-0007PO-Cb for qemu-devel@nongnu.org; Wed, 24 Oct 2012 06:49:22 -0400 From: Dietmar Maurer Date: Wed, 24 Oct 2012 12:10:47 +0200 Message-Id: <1351073447-643298-1-git-send-email-dietmar@proxmox.com> Subject: [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Dietmar Maurer The formula to compute slice_quota was wrong. Signed-off-by: Dietmar Maurer --- include/qemu/ratelimit.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 -- 1.7.2.5