diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-01-18 21:23:52 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-04-10 16:33:47 +0200 |
commit | 2fe4bba19b754b3872a58e53fa49c2b93b398301 (patch) | |
tree | f911b25e31a0b00f01e07e55cb7a047e70d9e8ef /block/commit.c | |
parent | ad53ea42feda0ced5a44d48ea165fd434a016744 (diff) | |
download | qemu-2fe4bba19b754b3872a58e53fa49c2b93b398301.zip qemu-2fe4bba19b754b3872a58e53fa49c2b93b398301.tar.gz qemu-2fe4bba19b754b3872a58e53fa49c2b93b398301.tar.bz2 |
commit/stream: Reset delay_ns
Streaming and the commit block job only want to apply throttling when
they actually copied data instead of skipping it, so they made the
calculation of delay_ns conditional. However, delay_ns isn't reset when
skipping some sectors, so instead of not waiting, the old delay is
applied again.
Properly reset delay_ns where needed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/commit.c')
-rw-r--r-- | block/commit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/commit.c b/block/commit.c index ab4fa3c..1432bae 100644 --- a/block/commit.c +++ b/block/commit.c @@ -202,6 +202,8 @@ static void coroutine_fn commit_run(void *opaque) if (copy && s->common.speed) { delay_ns = ratelimit_calculate_delay(&s->limit, n); + } else { + delay_ns = 0; } } |