From patchwork Wed Oct 24 10:10:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Maurer X-Patchwork-Id: 194010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B39EA2C00A7 for ; Thu, 25 Oct 2012 10:14:07 +1100 (EST) Received: from localhost ([::1]:37613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRA9F-000840-MW for incoming@patchwork.ozlabs.org; Wed, 24 Oct 2012 19:14:05 -0400 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 Received: by maui.maurer-it.com (Postfix, from userid 0) id 1FBD83B0855; Wed, 24 Oct 2012 12:10:51 +0200 (CEST) From: Dietmar Maurer To: qemu-devel@nongnu.org Date: Wed, 24 Oct 2012 12:10:47 +0200 Message-Id: <1351073447-643298-1-git-send-email-dietmar@proxmox.com> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.129.239.114 X-Mailman-Approved-At: Wed, 24 Oct 2012 19:13:52 -0400 Cc: pbonzini@redhat.com, Dietmar Maurer Subject: [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The formula to compute slice_quota was wrong. Signed-off-by: Dietmar Maurer Reviewed-by: Eric Blake --- 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