Il 12/03/2012 07:29, zwu.ker...@gmail.com ha scritto:
> From: Zhi Yong Wu <wu...@linux.vnet.ibm.com>
> 
> Signed-off-by: Zhi Yong Wu <wu...@linux.vnet.ibm.com>
> ---
>  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