qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/2] block: add the support to drain throttle


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 1/2] block: add the support to drain throttled requests
Date: Mon, 12 Mar 2012 08:27:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

Il 12/03/2012 07:29, address@hidden ha scritto:
> From: Zhi Yong Wu <address@hidden>
> 
> Signed-off-by: Zhi Yong Wu <address@hidden>
> ---
>  block.c     |   21 +++++++++++++++++++++
>  block_int.h |    1 +
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 52ffe14..0825168 100644
> --- a/block.c
> +++ b/block.c
> @@ -853,6 +853,21 @@ void bdrv_close_all(void)
>      }
>  }
>  
> +/**
> + * Complete all pending requests for a block device
> + */
> +void bdrv_drain(BlockDriverState *bs)
> +{
> +    do {
> +        qemu_co_queue_restart_all(&bs->throttled_reqs);
> +    } while (!qemu_co_queue_empty(&bs->throttled_reqs));
> +
> +    qemu_aio_flush();

This doesn't work, qemu_aio_flush can start new I/O.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]