diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-05-24 17:21:22 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-07-05 16:46:26 +0200 |
commit | 28b04a8f655820cca2cc1c8fe409462b46d50d41 (patch) | |
tree | 065392421872b590eecf23c42a392a6eba539c88 | |
parent | db1e80ee2ed6fc9eb6b203873b39752144f5577f (diff) | |
download | qemu-28b04a8f655820cca2cc1c8fe409462b46d50d41.zip qemu-28b04a8f655820cca2cc1c8fe409462b46d50d41.tar.gz qemu-28b04a8f655820cca2cc1c8fe409462b46d50d41.tar.bz2 |
block: Convert bdrv_co_readv() to BdrvChild
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | block/crypto.c | 2 | ||||
-rw-r--r-- | block/io.c | 8 | ||||
-rw-r--r-- | block/parallels.c | 2 | ||||
-rw-r--r-- | block/qcow.c | 5 | ||||
-rw-r--r-- | block/raw_bsd.c | 2 | ||||
-rw-r--r-- | block/vhdx.c | 2 | ||||
-rw-r--r-- | include/block/block.h | 4 |
7 files changed, 12 insertions, 13 deletions
diff --git a/block/crypto.c b/block/crypto.c index ec1f247..87b1e00 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -428,7 +428,7 @@ block_crypto_co_readv(BlockDriverState *bs, int64_t sector_num, qemu_iovec_reset(&hd_qiov); qemu_iovec_add(&hd_qiov, cipher_data, cur_nr_sectors * 512); - ret = bdrv_co_readv(bs->file->bs, + ret = bdrv_co_readv(bs->file, payload_offset + sector_num, cur_nr_sectors, &hd_qiov); if (ret < 0) { @@ -1141,12 +1141,12 @@ static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs, nb_sectors << BDRV_SECTOR_BITS, qiov, flags); } -int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num, - int nb_sectors, QEMUIOVector *qiov) +int coroutine_fn bdrv_co_readv(BdrvChild *child, int64_t sector_num, + int nb_sectors, QEMUIOVector *qiov) { - trace_bdrv_co_readv(bs, sector_num, nb_sectors); + trace_bdrv_co_readv(child->bs, sector_num, nb_sectors); - return bdrv_co_do_readv(bs, sector_num, nb_sectors, qiov, 0); + return bdrv_co_do_readv(child->bs, sector_num, nb_sectors, qiov, 0); } /* Maximum buffer for write zeroes fallback, in bytes */ diff --git a/block/parallels.c b/block/parallels.c index d6a1a61..7da01fb 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -351,7 +351,7 @@ static coroutine_fn int parallels_co_readv(BlockDriverState *bs, qemu_iovec_reset(&hd_qiov); qemu_iovec_concat(&hd_qiov, qiov, bytes_done, nbytes); - ret = bdrv_co_readv(bs->file->bs, position, n, &hd_qiov); + ret = bdrv_co_readv(bs->file, position, n, &hd_qiov); if (ret < 0) { break; } diff --git a/block/qcow.c b/block/qcow.c index e4175b8..c8d4e5f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -619,8 +619,7 @@ static coroutine_fn int qcow_co_readv(BlockDriverState *bs, int64_t sector_num, hd_iov.iov_len = n * 512; qemu_iovec_init_external(&hd_qiov, &hd_iov, 1); qemu_co_mutex_unlock(&s->lock); - ret = bdrv_co_readv(bs->backing->bs, sector_num, - n, &hd_qiov); + ret = bdrv_co_readv(bs->backing, sector_num, n, &hd_qiov); qemu_co_mutex_lock(&s->lock); if (ret < 0) { goto fail; @@ -644,7 +643,7 @@ static coroutine_fn int qcow_co_readv(BlockDriverState *bs, int64_t sector_num, hd_iov.iov_len = n * 512; qemu_iovec_init_external(&hd_qiov, &hd_iov, 1); qemu_co_mutex_unlock(&s->lock); - ret = bdrv_co_readv(bs->file->bs, + ret = bdrv_co_readv(bs->file, (cluster_offset >> 9) + index_in_cluster, n, &hd_qiov); qemu_co_mutex_lock(&s->lock); diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 5855e84..90b296e 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -54,7 +54,7 @@ static int coroutine_fn raw_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov) { BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - return bdrv_co_readv(bs->file->bs, sector_num, nb_sectors, qiov); + return bdrv_co_readv(bs->file, sector_num, nb_sectors, qiov); } static int coroutine_fn diff --git a/block/vhdx.c b/block/vhdx.c index 33b81e2..cca2540 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1117,7 +1117,7 @@ static coroutine_fn int vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, break; case PAYLOAD_BLOCK_FULLY_PRESENT: qemu_co_mutex_unlock(&s->lock); - ret = bdrv_co_readv(bs->file->bs, + ret = bdrv_co_readv(bs->file, sinfo.file_offset >> BDRV_SECTOR_BITS, sinfo.sectors_avail, &hd_qiov); qemu_co_mutex_lock(&s->lock); diff --git a/include/block/block.h b/include/block/block.h index 211a0f2..16ec088 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -241,8 +241,8 @@ int bdrv_pwrite(BlockDriverState *bs, int64_t offset, int bdrv_pwritev(BlockDriverState *bs, int64_t offset, QEMUIOVector *qiov); int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset, const void *buf, int count); -int coroutine_fn bdrv_co_readv(BlockDriverState *bs, int64_t sector_num, - int nb_sectors, QEMUIOVector *qiov); +int coroutine_fn bdrv_co_readv(BdrvChild *child, int64_t sector_num, + int nb_sectors, QEMUIOVector *qiov); int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov); /* |