diff --git a/block/blkdebug.c b/block/blkdebug.c index b6ecee379dfd9441103ef51b64fb3f99744e0688..499de40e423709de663a759afca8e88dab5632cc 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -457,7 +457,7 @@ static BlockAIOCB *blkdebug_aio_readv(BlockDriverState *bs, return inject_error(bs, cb, opaque, rule); } - return bdrv_aio_readv(bs->file->bs, sector_num, qiov, nb_sectors, + return bdrv_aio_readv(bs->file, sector_num, qiov, nb_sectors, cb, opaque); } diff --git a/block/blkverify.c b/block/blkverify.c index 4045396a3d98cce0c44c0a7f0e42e3b704764dec..4672fdadf473f4794c00b49353b22135e39c4d81 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -247,9 +247,9 @@ static BlockAIOCB *blkverify_aio_readv(BlockDriverState *bs, qemu_iovec_init(&acb->raw_qiov, acb->qiov->niov); qemu_iovec_clone(&acb->raw_qiov, qiov, acb->buf); - bdrv_aio_readv(s->test_file->bs, sector_num, qiov, nb_sectors, + bdrv_aio_readv(s->test_file, sector_num, qiov, nb_sectors, blkverify_aio_cb, acb); - bdrv_aio_readv(bs->file->bs, sector_num, &acb->raw_qiov, nb_sectors, + bdrv_aio_readv(bs->file, sector_num, &acb->raw_qiov, nb_sectors, blkverify_aio_cb, acb); return &acb->common; } diff --git a/block/io.c b/block/io.c index 17e4ad47ec0f4c254ba84126746271388c9f2464..696a79d5922861e3b95896b549715846f9d15a62 100644 --- a/block/io.c +++ b/block/io.c @@ -1962,13 +1962,13 @@ int bdrv_readv_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos) /**************************************************************/ /* async I/Os */ -BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num, +BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque) { - trace_bdrv_aio_readv(bs, sector_num, nb_sectors, opaque); + trace_bdrv_aio_readv(child->bs, sector_num, nb_sectors, opaque); - return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0, + return bdrv_co_aio_rw_vector(child->bs, sector_num, qiov, nb_sectors, 0, cb, opaque, false); } diff --git a/block/qed-table.c b/block/qed-table.c index c841ad10fe199009196adbda6133b16c0900088a..2db0a332e99805eb0e69960fe1b777e3cf4f88bf 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -65,7 +65,7 @@ static void qed_read_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, read_table_cb->iov.iov_len = s->header.cluster_size * s->header.table_size, qemu_iovec_init_external(qiov, &read_table_cb->iov, 1); - bdrv_aio_readv(s->bs->file->bs, offset / BDRV_SECTOR_SIZE, qiov, + bdrv_aio_readv(s->bs->file, offset / BDRV_SECTOR_SIZE, qiov, qiov->size / BDRV_SECTOR_SIZE, qed_read_table_cb, read_table_cb); } diff --git a/block/qed.c b/block/qed.c index 12068061ac1cfea1367a7f2e2415e66a101e8c02..7f71007ebb1d02d34700252575a268e20ff2dbb7 100644 --- a/block/qed.c +++ b/block/qed.c @@ -155,7 +155,7 @@ static void qed_write_header(BDRVQEDState *s, BlockCompletionFunc cb, write_header_cb->iov.iov_len = len; qemu_iovec_init_external(&write_header_cb->qiov, &write_header_cb->iov, 1); - bdrv_aio_readv(s->bs->file->bs, 0, &write_header_cb->qiov, nsectors, + bdrv_aio_readv(s->bs->file, 0, &write_header_cb->qiov, nsectors, qed_write_header_read_cb, write_header_cb); } @@ -800,7 +800,7 @@ static void qed_read_backing_file(BDRVQEDState *s, uint64_t pos, qemu_iovec_concat(*backing_qiov, qiov, 0, size); BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO); - bdrv_aio_readv(s->bs->backing->bs, pos / BDRV_SECTOR_SIZE, + bdrv_aio_readv(s->bs->backing, pos / BDRV_SECTOR_SIZE, *backing_qiov, size / BDRV_SECTOR_SIZE, cb, opaque); } @@ -1319,7 +1319,7 @@ static void qed_aio_read_data(void *opaque, int ret, } BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - bdrv_aio_readv(bs->file->bs, offset / BDRV_SECTOR_SIZE, + bdrv_aio_readv(bs->file, offset / BDRV_SECTOR_SIZE, &acb->cur_qiov, acb->cur_qiov.size / BDRV_SECTOR_SIZE, qed_aio_next_io, acb); return; diff --git a/block/quorum.c b/block/quorum.c index 331b726f97959be850dc9dbc3a4ea73adfbc07fe..c365c78f9bbcba7044e25034efbbcc55a7e83b13 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -660,7 +660,7 @@ static BlockAIOCB *read_quorum_children(QuorumAIOCB *acb) } for (i = 0; i < s->num_children; i++) { - acb->qcrs[i].aiocb = bdrv_aio_readv(s->children[i]->bs, acb->sector_num, + acb->qcrs[i].aiocb = bdrv_aio_readv(s->children[i], acb->sector_num, &acb->qcrs[i].qiov, acb->nb_sectors, quorum_aio_cb, &acb->qcrs[i]); } @@ -678,7 +678,7 @@ static BlockAIOCB *read_fifo_child(QuorumAIOCB *acb) qemu_iovec_clone(&acb->qcrs[acb->child_iter].qiov, acb->qiov, acb->qcrs[acb->child_iter].buf); acb->qcrs[acb->child_iter].aiocb = - bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num, + bdrv_aio_readv(s->children[acb->child_iter], acb->sector_num, &acb->qcrs[acb->child_iter].qiov, acb->nb_sectors, quorum_aio_cb, &acb->qcrs[acb->child_iter]); diff --git a/include/block/block.h b/include/block/block.h index 70b1b80ca96b86091d7278be77ecf9e9e0f9f694..ac8a1d7e7390d66903cdef9897f8579c7524f0b5 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -310,7 +310,7 @@ BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs, const char *node_name, Error **errp); /* async block I/O */ -BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num, +BlockAIOCB *bdrv_aio_readv(BdrvChild *child, int64_t sector_num, QEMUIOVector *iov, int nb_sectors, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,