aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-05-24 17:21:22 +0200
committerKevin Wolf <kwolf@redhat.com>2016-07-05 16:46:26 +0200
commit25ec177d90de0992f4d4d5be8ab1e02b9fa2bdf1 (patch)
tree35864d9b886059572839bcdf3e4aa482c36187b8
parent28b04a8f655820cca2cc1c8fe409462b46d50d41 (diff)
downloadqemu-25ec177d90de0992f4d4d5be8ab1e02b9fa2bdf1.zip
qemu-25ec177d90de0992f4d4d5be8ab1e02b9fa2bdf1.tar.gz
qemu-25ec177d90de0992f4d4d5be8ab1e02b9fa2bdf1.tar.bz2
block: Convert bdrv_co_writev() 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.c2
-rw-r--r--block/io.c6
-rw-r--r--block/parallels.c2
-rw-r--r--block/qcow.c2
-rw-r--r--block/vhdx.c2
-rw-r--r--include/block/block.h4
6 files changed, 9 insertions, 9 deletions
diff --git a/block/crypto.c b/block/crypto.c
index 87b1e00..64bf095 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -507,7 +507,7 @@ block_crypto_co_writev(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_writev(bs->file->bs,
+ ret = bdrv_co_writev(bs->file,
payload_offset + sector_num,
cur_nr_sectors, &hd_qiov);
if (ret < 0) {
diff --git a/block/io.c b/block/io.c
index c988e1b..17e4ad4 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1547,12 +1547,12 @@ static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs,
nb_sectors << BDRV_SECTOR_BITS, qiov, flags);
}
-int coroutine_fn bdrv_co_writev(BlockDriverState *bs, int64_t sector_num,
+int coroutine_fn bdrv_co_writev(BdrvChild *child, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
- trace_bdrv_co_writev(bs, sector_num, nb_sectors);
+ trace_bdrv_co_writev(child->bs, sector_num, nb_sectors);
- return bdrv_co_do_writev(bs, sector_num, nb_sectors, qiov, 0);
+ return bdrv_co_do_writev(child->bs, sector_num, nb_sectors, qiov, 0);
}
int coroutine_fn bdrv_co_pwrite_zeroes(BlockDriverState *bs,
diff --git a/block/parallels.c b/block/parallels.c
index 7da01fb..91ab61f 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -311,7 +311,7 @@ static coroutine_fn int parallels_co_writev(BlockDriverState *bs,
qemu_iovec_reset(&hd_qiov);
qemu_iovec_concat(&hd_qiov, qiov, bytes_done, nbytes);
- ret = bdrv_co_writev(bs->file->bs, position, n, &hd_qiov);
+ ret = bdrv_co_writev(bs->file, position, n, &hd_qiov);
if (ret < 0) {
break;
}
diff --git a/block/qcow.c b/block/qcow.c
index c8d4e5f..0db43f8 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -745,7 +745,7 @@ static coroutine_fn int qcow_co_writev(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_writev(bs->file->bs,
+ ret = bdrv_co_writev(bs->file,
(cluster_offset >> 9) + index_in_cluster,
n, &hd_qiov);
qemu_co_mutex_lock(&s->lock);
diff --git a/block/vhdx.c b/block/vhdx.c
index cca2540..b0f66de 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1326,7 +1326,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num,
}
/* block exists, so we can just overwrite it */
qemu_co_mutex_unlock(&s->lock);
- ret = bdrv_co_writev(bs->file->bs,
+ ret = bdrv_co_writev(bs->file,
sinfo.file_offset >> BDRV_SECTOR_BITS,
sectors_to_write, &hd_qiov);
qemu_co_mutex_lock(&s->lock);
diff --git a/include/block/block.h b/include/block/block.h
index 16ec088..70b1b80 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -243,8 +243,8 @@ int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
const void *buf, int count);
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);
+int coroutine_fn bdrv_co_writev(BdrvChild *child, int64_t sector_num,
+ int nb_sectors, QEMUIOVector *qiov);
/*
* Efficiently zero a region of the disk image. Note that this is a regular
* I/O request like read or write and should have a reasonable size. This