[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/7] commit/stream: Reset delay_ns
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 6/7] commit/stream: Reset delay_ns |
Date: |
Tue, 10 Apr 2018 17:37:47 +0200 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/commit.c | 2 ++
block/stream.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/block/commit.c b/block/commit.c
index ab4fa3c3cf..1432baeef4 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;
}
}
diff --git a/block/stream.c b/block/stream.c
index f3b53f49e2..1a85708fcf 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -188,6 +188,8 @@ static void coroutine_fn stream_run(void *opaque)
s->common.offset += n;
if (copy && s->common.speed) {
delay_ns = ratelimit_calculate_delay(&s->limit, n);
+ } else {
+ delay_ns = 0;
}
}
--
2.13.6
- [Qemu-devel] [PULL 0/7] Block layer patches for 2.12.0-rc3, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 3/7] iotests.py: improve verify_image_format helper, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 2/7] hw/block/pflash_cfi: fix off-by-one error, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 4/7] iotests: blacklist bochs and cloop for 205 and 208, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 6/7] commit/stream: Reset delay_ns,
Kevin Wolf <=
- [Qemu-devel] [PULL 7/7] qemu-iotests: update 185 output, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 5/7] qemu-iotests: Remove _supported_fmt dmg, Kevin Wolf, 2018/04/10
- [Qemu-devel] [PULL 1/7] iotests.py: support unsupported_fmts in main(), Kevin Wolf, 2018/04/10
- Re: [Qemu-devel] [PULL 0/7] Block layer patches for 2.12.0-rc3, Peter Maydell, 2018/04/11