aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-09-04 12:03:06 +0200
committerKevin Wolf <kwolf@redhat.com>2023-10-12 16:31:33 +0200
commitcc323997731bb1c2a9896fcca668b57d82d62153 (patch)
tree18f37fcc7315e89f931202a188a05c6c8ac48e2e /block/qcow2.c
parent578ffa9ffb13d9a40790de2a3dda8730d4d43efc (diff)
block: convert more bdrv_is_allocated* and bdrv_block_status* calls to coroutine versions
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20230904100306.156197-5-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 5a3c537f14..6e9c731bac 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3991,7 +3991,8 @@ finish:
}
-static bool is_zero(BlockDriverState *bs, int64_t offset, int64_t bytes)
+static bool coroutine_fn GRAPH_RDLOCK
+is_zero(BlockDriverState *bs, int64_t offset, int64_t bytes)
{
int64_t nr;
int res;
@@ -4012,7 +4013,7 @@ static bool is_zero(BlockDriverState *bs, int64_t offset, int64_t bytes)
* backing file. So, we need a loop.
*/
do {
- res = bdrv_block_status_above(bs, NULL, offset, bytes, &nr, NULL, NULL);
+ res = bdrv_co_block_status_above(bs, NULL, offset, bytes, &nr, NULL, NULL);
offset += nr;
bytes -= nr;
} while (res >= 0 && (res & BDRV_BLOCK_ZERO) && nr && bytes);