mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
block-coroutine-wrapper: Add no_co_wrapper_bdrv_rdlock functions
Add a new wrapper type for GRAPH_RDLOCK functions that should be called from coroutine context. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20230929145157.45443-3-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
903df115aa
commit
e84c07bc73
2 changed files with 12 additions and 5 deletions
|
@ -66,13 +66,16 @@
|
|||
* function. The coroutine yields after scheduling the BH and is reentered when
|
||||
* the wrapped function returns.
|
||||
*
|
||||
* A no_co_wrapper_bdrv_wrlock function is a no_co_wrapper function that
|
||||
* automatically takes the graph wrlock when calling the wrapped function.
|
||||
* A no_co_wrapper_bdrv_rdlock function is a no_co_wrapper function that
|
||||
* automatically takes the graph rdlock when calling the wrapped function. In
|
||||
* the same way, no_co_wrapper_bdrv_wrlock functions automatically take the
|
||||
* graph wrlock.
|
||||
*
|
||||
* If the first parameter of the function is a BlockDriverState, BdrvChild or
|
||||
* BlockBackend pointer, the AioContext lock for it is taken in the wrapper.
|
||||
*/
|
||||
#define no_co_wrapper
|
||||
#define no_co_wrapper_bdrv_rdlock
|
||||
#define no_co_wrapper_bdrv_wrlock
|
||||
|
||||
#include "block/blockjob.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue