qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed
@ 2012-10-24 10:10 Dietmar Maurer
  2012-10-24 23:29 ` Eric Blake
  2012-11-21 13:24 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Dietmar Maurer @ 2012-10-24 10:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Dietmar Maurer

The formula to compute slice_quota was wrong.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed
  2012-10-24 10:10 [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed Dietmar Maurer
@ 2012-10-24 23:29 ` Eric Blake
  2012-11-21 13:24 ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2012-10-24 23:29 UTC (permalink / raw)
  To: Dietmar Maurer; +Cc: pbonzini, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

On 10/24/2012 04:10 AM, Dietmar Maurer wrote:
> The formula to compute slice_quota was wrong.
> 
> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
> ---
>  include/qemu/ratelimit.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

However, it might also be nice to point to the commit introducing the
bug in the commit message (6ef228fc0de)

> 
> 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
> 

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed
  2012-10-24 10:10 [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed Dietmar Maurer
  2012-10-24 23:29 ` Eric Blake
@ 2012-11-21 13:24 ` Paolo Bonzini
  2012-11-26 16:23   ` Kevin Wolf
  1 sibling, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2012-11-21 13:24 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Dietmar Maurer, qemu-devel

Il 24/10/2012 12:10, Dietmar Maurer ha scritto:
> The formula to compute slice_quota was wrong.
> 
> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
> ---
>  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
> 

Ping... Stefan, can you commit this fix to block branch too?

Paolo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed
  2012-11-21 13:24 ` Paolo Bonzini
@ 2012-11-26 16:23   ` Kevin Wolf
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2012-11-26 16:23 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Stefan Hajnoczi, Dietmar Maurer

Am 21.11.2012 14:24, schrieb Paolo Bonzini:
> Il 24/10/2012 12:10, Dietmar Maurer ha scritto:
>> The formula to compute slice_quota was wrong.
>>
>> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
>> ---
>>  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
>>
> 
> Ping... Stefan, can you commit this fix to block branch too?

Thanks, applied to the block branch for 1.3.

Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-26 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24 10:10 [Qemu-devel] [PATCH] stream: fix ratelimit_set_speed Dietmar Maurer
2012-10-24 23:29 ` Eric Blake
2012-11-21 13:24 ` Paolo Bonzini
2012-11-26 16:23   ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).