aboutsummaryrefslogtreecommitdiff
path: root/include/block/block-io.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-06-01 13:51:45 +0200
committerKevin Wolf <kwolf@redhat.com>2023-06-28 09:46:34 +0200
commit17362398ee1a7f04e8006a46333145d8b707fd35 (patch)
tree47b1070a6b7d8ebfd4848237ac899cb8d53b1794 /include/block/block-io.h
parent0af02bd10783e08220a784eb8d7e2f821a64f0fa (diff)
block: use bdrv_co_debug_event in coroutine context
bdrv_co_debug_event was recently introduced, with bdrv_debug_event becoming a wrapper for use in unknown context. Because most of the time bdrv_debug_event is used on a BdrvChild via the wrapper macro BLKDBG_EVENT, introduce a similar macro BLKDBG_CO_EVENT that calls bdrv_co_debug_event, and switch whenever possible. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20230601115145.196465-13-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block-io.h')
-rw-r--r--include/block/block-io.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/block/block-io.h b/include/block/block-io.h
index 43af816d75..4415506e40 100644
--- a/include/block/block-io.h
+++ b/include/block/block-io.h
@@ -224,6 +224,13 @@ bdrv_co_debug_event(BlockDriverState *bs, BlkdebugEvent event);
void co_wrapper_mixed_bdrv_rdlock
bdrv_debug_event(BlockDriverState *bs, BlkdebugEvent event);
+#define BLKDBG_CO_EVENT(child, evt) \
+ do { \
+ if (child) { \
+ bdrv_co_debug_event(child->bs, evt); \
+ } \
+ } while (0)
+
#define BLKDBG_EVENT(child, evt) \
do { \
if (child) { \