diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-06-01 13:51:35 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-06-28 09:46:20 +0200 |
commit | bba667da7f19e3dc68a418d0b87e5978a16f89e9 (patch) | |
tree | dbb9a3f633fdfe988dcd74ea632b291cda71a214 /block/qed-check.c | |
parent | 36c6c8773a20e0205046f95c5688b3f17a4d552d (diff) | |
download | qemu-bba667da7f19e3dc68a418d0b87e5978a16f89e9.zip qemu-bba667da7f19e3dc68a418d0b87e5978a16f89e9.tar.gz qemu-bba667da7f19e3dc68a418d0b87e5978a16f89e9.tar.bz2 |
qed: mark more functions as coroutine_fns and GRAPH_RDLOCK
Mark functions as coroutine_fn when they are only called by other coroutine_fns
and they can suspend. Change calls to co_wrappers to use the non-wrapped
functions, which in turn requires adding GRAPH_RDLOCK annotations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20230601115145.196465-3-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qed-check.c')
-rw-r--r-- | block/qed-check.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/qed-check.c b/block/qed-check.c index 8fd94f4..6a01b94 100644 --- a/block/qed-check.c +++ b/block/qed-check.c @@ -200,7 +200,8 @@ static void qed_check_for_leaks(QEDCheck *check) /** * Mark an image clean once it passes check or has been repaired */ -static void qed_check_mark_clean(BDRVQEDState *s, BdrvCheckResult *result) +static void coroutine_fn GRAPH_RDLOCK +qed_check_mark_clean(BDRVQEDState *s, BdrvCheckResult *result) { /* Skip if there were unfixable corruptions or I/O errors */ if (result->corruptions > 0 || result->check_errors > 0) { @@ -213,7 +214,7 @@ static void qed_check_mark_clean(BDRVQEDState *s, BdrvCheckResult *result) } /* Ensure fixes reach storage before clearing check bit */ - bdrv_flush(s->bs); + bdrv_co_flush(s->bs); s->header.features &= ~QED_F_NEED_CHECK; qed_write_header_sync(s); |