[GEDI] [PATCH 00/15] Protect the block layer with a rwlock: part 3

Paolo Bonzini pbonzini at redhat.com
Fri Nov 18 10:57:21 UTC 2022


On 11/16/22 15:07, Emanuele Giuseppe Esposito wrote:
> Here we introduce generated_co_wrapper_simple, a simplification of g_c_w that
> only considers the case where the caller is not in a coroutine.
> This simplifies and clarifies a lot when the caller is a coroutine or not, and
> in the future will hopefully replace g_c_w.

This is a good idea!

Just one thing, though it belongs more in the two series which 
introduced generated_co_wrapper_simple and generated_co_wrapper_blk - I 
would make this the "official" wrapper.  So perhaps:

- generated_co_wrapper_simple -> coroutine_wrapper
- generated_co_wrapper_blk -> coroutine_wrapper_mixed
- generated_co_wrapper -> coroutine_wrapper_mixed_bdrv

?  It is not clear to me yet if you will have bdrv_* functions that take 
the rdlock as well - in which case however coroutine_wrapper_bdrv would 
not be hard to add.

Even without looking at the lock, the three series are going in the 
right direction of ultimately having more "simple" coroutine wrappers at 
the blk_* level and more coroutine functions (ultimately less wrappers, 
too) at the bdrv_* level.

Paolo



More information about the integration mailing list