aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-09-29 16:51:37 +0200
committerKevin Wolf <kwolf@redhat.com>2023-10-12 16:31:33 +0200
commite84c07bc73f63cd0251d9fd2c582ad051e27fb39 (patch)
treedf70b1813e5cf5b49790deb188e311a05ab596df /include
parent903df115aaa5b9455ffde2894002f3f4820868bd (diff)
downloadqemu-e84c07bc73f63cd0251d9fd2c582ad051e27fb39.zip
qemu-e84c07bc73f63cd0251d9fd2c582ad051e27fb39.tar.gz
qemu-e84c07bc73f63cd0251d9fd2c582ad051e27fb39.tar.bz2
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>
Diffstat (limited to 'include')
-rw-r--r--include/block/block-common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/block/block-common.h b/include/block/block-common.h
index 2d2af72..d759956 100644
--- a/include/block/block-common.h
+++ b/include/block/block-common.h
@@ -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"