qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in t


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH 10/16] block: explicitly acquire aiocontext in timers that need it
Date: Mon, 16 Jan 2017 21:07:02 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

On Fri, 01/13 14:17, Paolo Bonzini wrote:
> diff --git a/block/qed.c b/block/qed.c
> index 7f1c508..a21d025 100644
> --- a/block/qed.c
> +++ b/block/qed.c
> @@ -345,10 +345,22 @@ static void qed_need_check_timer_cb(void *opaque)
>  
>      trace_qed_need_check_timer_cb(s);
>  
> +    qed_acquire(s);
>      qed_plug_allocating_write_reqs(s);
>  
>      /* Ensure writes are on disk before clearing flag */
>      bdrv_aio_flush(s->bs->file->bs, qed_clear_need_check, s);
> +    qed_release(s);
> +}
> +
> +void qed_acquire(BDRVQEDState *s)
> +{
> +    aio_context_acquire(bdrv_get_aio_context(s->bs));
> +}
> +
> +void qed_release(BDRVQEDState *s)
> +{
> +    aio_context_release(bdrv_get_aio_context(s->bs));
>  }
>  
>  static void qed_start_need_check_timer(BDRVQEDState *s)
> diff --git a/block/qed.h b/block/qed.h
> index 9676ab9..ce8c314 100644
> --- a/block/qed.h
> +++ b/block/qed.h
> @@ -198,6 +198,9 @@ enum {
>   */
>  typedef void QEDFindClusterFunc(void *opaque, int ret, uint64_t offset, 
> size_t len);
>  
> +void qed_acquire(BDRVQEDState *s);
> +void qed_release(BDRVQEDState *s);
> +

Why cannot these be local (static) functions, in block/qed.c?

>  /**
>   * Generic callback for chaining async callbacks
>   */

Fam



reply via email to

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