aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-06-20 20:09:15 +0200
committerKevin Wolf <kwolf@redhat.com>2016-07-05 16:46:27 +0200
commitd9ca2ea2e261442c267f542953a5f3243e4f608e (patch)
treead020b3c0d4f341972e0ad8bcaaace9f3785728d /block/vmdk.c
parentcf2ab8fc345c34f8671fade9230746610e4fc340 (diff)
downloadqemu-d9ca2ea2e261442c267f542953a5f3243e4f608e.zip
qemu-d9ca2ea2e261442c267f542953a5f3243e4f608e.tar.gz
qemu-d9ca2ea2e261442c267f542953a5f3243e4f608e.tar.bz2
block: Convert bdrv_pwrite(v/_sync) to BdrvChild
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index a2c85a2..ae70b63 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -306,7 +306,7 @@ static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)
pstrcat(desc, DESC_SIZE, tmp_desc);
}
- ret = bdrv_pwrite_sync(bs->file->bs, s->desc_offset, desc, DESC_SIZE);
+ ret = bdrv_pwrite_sync(bs->file, s->desc_offset, desc, DESC_SIZE);
out:
g_free(desc);
@@ -1052,7 +1052,7 @@ static int get_whole_cluster(BlockDriverState *bs,
goto exit;
}
}
- ret = bdrv_pwrite(extent->file->bs, cluster_offset, whole_grain,
+ ret = bdrv_pwrite(extent->file, cluster_offset, whole_grain,
skip_start_bytes);
if (ret < 0) {
ret = VMDK_ERROR;
@@ -1070,7 +1070,7 @@ static int get_whole_cluster(BlockDriverState *bs,
goto exit;
}
}
- ret = bdrv_pwrite(extent->file->bs, cluster_offset + skip_end_bytes,
+ ret = bdrv_pwrite(extent->file, cluster_offset + skip_end_bytes,
whole_grain + skip_end_bytes,
cluster_bytes - skip_end_bytes);
if (ret < 0) {
@@ -1090,8 +1090,7 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data,
{
offset = cpu_to_le32(offset);
/* update L2 table */
- if (bdrv_pwrite_sync(
- extent->file->bs,
+ if (bdrv_pwrite_sync(extent->file,
((int64_t)m_data->l2_offset * 512)
+ (m_data->l2_index * sizeof(offset)),
&offset, sizeof(offset)) < 0) {
@@ -1100,8 +1099,7 @@ static int vmdk_L2update(VmdkExtent *extent, VmdkMetaData *m_data,
/* update backup L2 table */
if (extent->l1_backup_table_offset != 0) {
m_data->l2_offset = extent->l1_backup_table[m_data->l1_index];
- if (bdrv_pwrite_sync(
- extent->file->bs,
+ if (bdrv_pwrite_sync(extent->file,
((int64_t)m_data->l2_offset * 512)
+ (m_data->l2_index * sizeof(offset)),
&offset, sizeof(offset)) < 0) {