Il 24/10/2012 10:56, Dietmar Maurer ha scritto:
> The code to compute slice_quota seems buggy. The following fixes the issue:
>
> --- new.orig/include/qemu/ratelimit.h 2012-10-22 07:06:31.000000000 +0200
> +++ new/include/qemu/ratelimit.h 2012-10-22 07:06:49.000000000 +0200
> @@ -42,7 +42,7 @@
> 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
Ouch, you're right.
The patch that introduced include/qemu/ratelimit.h did:
- limit->slice_quota = speed / (1000000000ULL / SLICE_TIME);
+ limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns;
Can you submit the patch with a commit message and Signed-off-by line?
Paolo