qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 6/8] block: assert that graph read and writes are perf


From: Stefan Hajnoczi
Subject: Re: [RFC PATCH v2 6/8] block: assert that graph read and writes are performed correctly
Date: Thu, 28 Apr 2022 15:43:44 +0100

On Tue, Apr 26, 2022 at 04:51:12AM -0400, Emanuele Giuseppe Esposito wrote:
> diff --git a/include/block/graph-lock.h b/include/block/graph-lock.h
> index f171ba0527..2211d41286 100644
> --- a/include/block/graph-lock.h
> +++ b/include/block/graph-lock.h
> @@ -52,5 +52,20 @@ void coroutine_fn bdrv_graph_co_rdlock(void);
>   */
>  void coroutine_fn bdrv_graph_co_rdunlock(void);
>  
> +/*
> + * assert_bdrv_graph_readable:
> + * Make sure that the reader is either the main loop,
> + * or there is at least a reader helding the rdlock.
> + * In this way an incoming writer is aware of the read and waits.
> + */
> +void assert_bdrv_graph_readable(void);

The name confuses me. I suggest assert_bdrv_graph_rdlock_held().

> +
> +/*
> + * assert_bdrv_graph_writable:
> + * Make sure that the writer is the main loop and has set @has_writer,
> + * so that incoming readers will pause.
> + */
> +void assert_bdrv_graph_writable(void);

assert_bdrv_graph_wrlock_held().

> +
>  #endif /* BLOCK_LOCK_H */
>  
> -- 
> 2.31.1
> 

Attachment: signature.asc
Description: PGP signature


reply via email to

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