diff mbox series

[6/7] block/stream: use block_job_throttle

Message ID 20171214005953.8898-7-jsnow@redhat.com
State New
Headers show
Series blockjob: refactor mirror_throttle | expand

Commit Message

John Snow Dec. 14, 2017, 12:59 a.m. UTC
Signed-off-by: John Snow <jsnow@redhat.com>
---
 block/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Dec. 14, 2017, 8:50 a.m. UTC | #1
On 14/12/2017 01:59, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/stream.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/stream.c b/block/stream.c
> index e85af18c54..3ad3190387 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -139,7 +139,7 @@ static void coroutine_fn stream_run(void *opaque)
>          /* Note that even when no rate limit is applied we need to yield
>           * with no pending I/O here so that bdrv_drain_all() returns.
>           */
> -        block_job_sleep_ns(&s->common, delay_ns);
> +        block_job_throttle(&s->common, delay_ns);
>          if (block_job_is_cancelled(&s->common)) {
>              break;
>          }
> 

Nit, the previous patch is adding a blank line here, but this one isn't.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Stefan Hajnoczi Dec. 18, 2017, 2:29 p.m. UTC | #2
On Wed, Dec 13, 2017 at 07:59:52PM -0500, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/stream.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/block/stream.c b/block/stream.c
index e85af18c54..3ad3190387 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -139,7 +139,7 @@  static void coroutine_fn stream_run(void *opaque)
         /* Note that even when no rate limit is applied we need to yield
          * with no pending I/O here so that bdrv_drain_all() returns.
          */
-        block_job_sleep_ns(&s->common, delay_ns);
+        block_job_throttle(&s->common, delay_ns);
         if (block_job_is_cancelled(&s->common)) {
             break;
         }