]> git.ipfire.org Git - thirdparty/qemu.git/commit
mirror: fix throttling delay calculation
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Mar 2014 12:55:18 +0000 (13:55 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 25 Jun 2014 20:26:23 +0000 (15:26 -0500)
commit8211eeb7d26915d99a1d6a7eb79d09e862784f4a
tree69855f10631322bb93be6c250f202c0099d34de3
parent0414abe04f9782404ef08179763bca5e26633177
mirror: fix throttling delay calculation

The throttling delay calculation was using an inaccurate sector count to
calculate the time to sleep.  This broke rate-limiting for the block
mirror job.

Move the delay calculation into mirror_iteration() where we know how
many sectors were transferred.  This lets us calculate an accurate delay
time.

Reported-by: Joaquim Barrera <jbarrera@ac.upc.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit cc8c9d6c6f28e4e376a6561a2a31524fd069bc2d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/mirror.c
trace-events