]> git.proxmox.com Git - mirror_qemu.git/commit - block/mirror.c
mirror: fix throttling delay calculation
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Mar 2014 12:55:18 +0000 (13:55 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 25 Mar 2014 13:09:50 +0000 (14:09 +0100)
commitcc8c9d6c6f28e4e376a6561a2a31524fd069bc2d
treec61eeb89deb7dd3af6c4dd35c158279729bb8335
parentdc6fb73d219472e011d93867f5e7eebfffde0319
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>
block/mirror.c
trace-events