aboutsummaryrefslogtreecommitdiff
path: root/block/bochs.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-06-01 13:51:37 +0200
committerKevin Wolf <kwolf@redhat.com>2023-06-28 09:46:24 +0200
commite7918e96193dbaf334c480ddde58ebc1370a84f6 (patch)
tree2be642818c5fe0834983577fae52eefd463ba41c /block/bochs.c
parent517b5dfffdbddd34c0ab126a00421483d80d4318 (diff)
downloadqemu-e7918e96193dbaf334c480ddde58ebc1370a84f6.zip
qemu-e7918e96193dbaf334c480ddde58ebc1370a84f6.tar.gz
qemu-e7918e96193dbaf334c480ddde58ebc1370a84f6.tar.bz2
bochs: 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-5-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/bochs.c')
-rw-r--r--block/bochs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/bochs.c b/block/bochs.c
index 2f5ae52..66e7a58 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -203,7 +203,8 @@ static void bochs_refresh_limits(BlockDriverState *bs, Error **errp)
bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */
}
-static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num)
+static int64_t coroutine_fn GRAPH_RDLOCK
+seek_to_sector(BlockDriverState *bs, int64_t sector_num)
{
BDRVBochsState *s = bs->opaque;
uint64_t offset = sector_num * 512;
@@ -224,8 +225,8 @@ static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num)
(s->extent_blocks + s->bitmap_blocks));
/* read in bitmap for current extent */
- ret = bdrv_pread(bs->file, bitmap_offset + (extent_offset / 8), 1,
- &bitmap_entry, 0);
+ ret = bdrv_co_pread(bs->file, bitmap_offset + (extent_offset / 8), 1,
+ &bitmap_entry, 0);
if (ret < 0) {
return ret;
}