aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-10-13 14:37:08 +0200
committerKevin Wolf <kwolf@redhat.com>2022-10-27 20:14:11 +0200
commit3f6530282226587e9253e4129e2297e955cc90b2 (patch)
tree347077ee511c811e4169938808e7cad007621534 /block
parent3aba34adb19131ebfb996f700c518a0352a489ac (diff)
vdi: switch to *_co_* functions
Signed-off-by: Alberto Faria <afaria@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20221013123711.620631-22-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/vdi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/block/vdi.c b/block/vdi.c
index a9bafb5a9e..c0c111c4b9 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -663,7 +663,8 @@ vdi_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes,
* so this full-cluster write does not overlap a partial write
* of the same cluster, issued from the "else" branch.
*/
- ret = bdrv_pwrite(bs->file, data_offset, s->block_size, block, 0);
+ ret = bdrv_co_pwrite(bs->file, data_offset, s->block_size, block,
+ 0);
qemu_co_rwlock_unlock(&s->bmap_lock);
} else {
nonallocating_write:
@@ -708,7 +709,7 @@ nonallocating_write:
assert(VDI_IS_ALLOCATED(bmap_first));
*header = s->header;
vdi_header_to_le(header);
- ret = bdrv_pwrite(bs->file, 0, sizeof(*header), header, 0);
+ ret = bdrv_co_pwrite(bs->file, 0, sizeof(*header), header, 0);
g_free(header);
if (ret < 0) {
@@ -725,8 +726,8 @@ nonallocating_write:
base = ((uint8_t *)&s->bmap[0]) + bmap_first * SECTOR_SIZE;
logout("will write %u block map sectors starting from entry %u\n",
n_sectors, bmap_first);
- ret = bdrv_pwrite(bs->file, offset * SECTOR_SIZE,
- n_sectors * SECTOR_SIZE, base, 0);
+ ret = bdrv_co_pwrite(bs->file, offset * SECTOR_SIZE,
+ n_sectors * SECTOR_SIZE, base, 0);
}
return ret;
@@ -844,7 +845,7 @@ static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
vdi_header_print(&header);
}
vdi_header_to_le(&header);
- ret = blk_pwrite(blk, offset, sizeof(header), &header, 0);
+ ret = blk_co_pwrite(blk, offset, sizeof(header), &header, 0);
if (ret < 0) {
error_setg(errp, "Error writing header");
goto exit;
@@ -865,7 +866,7 @@ static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
bmap[i] = VDI_UNALLOCATED;
}
}
- ret = blk_pwrite(blk, offset, bmap_size, bmap, 0);
+ ret = blk_co_pwrite(blk, offset, bmap_size, bmap, 0);
if (ret < 0) {
error_setg(errp, "Error writing bmap");
goto exit;
@@ -874,8 +875,8 @@ static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
}
if (image_type == VDI_TYPE_STATIC) {
- ret = blk_truncate(blk, offset + blocks * block_size, false,
- PREALLOC_MODE_OFF, 0, errp);
+ ret = blk_co_truncate(blk, offset + blocks * block_size, false,
+ PREALLOC_MODE_OFF, 0, errp);
if (ret < 0) {
error_prepend(errp, "Failed to statically allocate file");
goto exit;