[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 21/24] vdi: switch to *_co_* functions
From: |
Paolo Bonzini |
Subject: |
[PATCH 21/24] vdi: switch to *_co_* functions |
Date: |
Thu, 13 Oct 2022 14:37:08 +0200 |
From: Alberto Faria <afaria@redhat.com>
Signed-off-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/vdi.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/block/vdi.c b/block/vdi.c
index e942325455..2ecf47216a 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -664,7 +664,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:
@@ -709,7 +710,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) {
@@ -726,8 +727,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;
@@ -845,7 +846,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;
@@ -866,7 +867,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;
@@ -875,8 +876,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;
--
2.37.3
- [PATCH 06/24] coroutine-lock: add missing coroutine_fn annotation to prototypes, (continued)
- [PATCH 06/24] coroutine-lock: add missing coroutine_fn annotation to prototypes, Paolo Bonzini, 2022/10/13
- [PATCH 07/24] coroutine-io: add missing coroutine_fn annotation to prototypes, Paolo Bonzini, 2022/10/13
- [PATCH 09/24] qcow2: add coroutine_fn annotation for indirect-called functions, Paolo Bonzini, 2022/10/13
- [PATCH 10/24] blkdebug: add missing coroutine_fn annotation for indirect-called functions, Paolo Bonzini, 2022/10/13
- [PATCH 12/24] qcow2: manually add more coroutine_fn annotations, Paolo Bonzini, 2022/10/13
- [PATCH 15/24] block: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 13/24] vmdk: manually add more coroutine_fn annotations, Paolo Bonzini, 2022/10/13
- [PATCH 22/24] vhdx: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 14/24] commit: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 11/24] qcow: manually add more coroutine_fn annotations, Paolo Bonzini, 2022/10/13
- [PATCH 21/24] vdi: switch to *_co_* functions,
Paolo Bonzini <=
- [PATCH 19/24] qcow2: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 24/24] monitor: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 17/24] parallels: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 16/24] mirror: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 23/24] vmdk: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 18/24] qcow: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- [PATCH 20/24] qed: switch to *_co_* functions, Paolo Bonzini, 2022/10/13
- Re: [PATCH 00/24] More coroutine_fn fixes, Kevin Wolf, 2022/10/27