aboutsummaryrefslogtreecommitdiff
path: root/block/vpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/vpc.c')
-rw-r--r--block/vpc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/block/vpc.c b/block/vpc.c
index 4d8f16e199..1ccdfb0557 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -252,7 +252,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
goto fail;
}
- ret = bdrv_pread(bs->file, 0, &s->footer, sizeof(s->footer));
+ ret = bdrv_pread(bs->file, 0, &s->footer, sizeof(s->footer), 0);
if (ret < 0) {
error_setg(errp, "Unable to read VHD header");
goto fail;
@@ -272,8 +272,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
}
/* If a fixed disk, the footer is found only at the end of the file */
- ret = bdrv_pread(bs->file, offset - sizeof(*footer),
- footer, sizeof(*footer));
+ ret = bdrv_pread(bs->file, offset - sizeof(*footer), footer,
+ sizeof(*footer), 0);
if (ret < 0) {
goto fail;
}
@@ -347,7 +347,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
if (disk_type == VHD_DYNAMIC) {
ret = bdrv_pread(bs->file, be64_to_cpu(footer->data_offset),
- &dyndisk_header, sizeof(dyndisk_header));
+ &dyndisk_header, sizeof(dyndisk_header), 0);
if (ret < 0) {
error_setg(errp, "Error reading dynamic VHD header");
goto fail;
@@ -402,7 +402,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
s->bat_offset = be64_to_cpu(dyndisk_header.table_offset);
ret = bdrv_pread(bs->file, s->bat_offset, s->pagetable,
- pagetable_size);
+ pagetable_size, 0);
if (ret < 0) {
error_setg(errp, "Error reading pagetable");
goto fail;
@@ -516,7 +516,8 @@ static inline int64_t get_image_offset(BlockDriverState *bs, uint64_t offset,
s->last_bitmap_offset = bitmap_offset;
memset(bitmap, 0xff, s->bitmap_size);
- r = bdrv_pwrite_sync(bs->file, bitmap_offset, bitmap, s->bitmap_size);
+ r = bdrv_pwrite_sync(bs->file, bitmap_offset, bitmap, s->bitmap_size,
+ 0);
if (r < 0) {
*err = r;
return -2;
@@ -538,7 +539,7 @@ static int rewrite_footer(BlockDriverState *bs)
BDRVVPCState *s = bs->opaque;
int64_t offset = s->free_data_block_offset;
- ret = bdrv_pwrite_sync(bs->file, offset, &s->footer, sizeof(s->footer));
+ ret = bdrv_pwrite_sync(bs->file, offset, &s->footer, sizeof(s->footer), 0);
if (ret < 0)
return ret;
@@ -573,7 +574,7 @@ static int64_t alloc_block(BlockDriverState *bs, int64_t offset)
/* Initialize the block's bitmap */
memset(bitmap, 0xff, s->bitmap_size);
ret = bdrv_pwrite_sync(bs->file, s->free_data_block_offset, bitmap,
- s->bitmap_size);
+ s->bitmap_size, 0);
if (ret < 0) {
return ret;
}
@@ -587,7 +588,7 @@ static int64_t alloc_block(BlockDriverState *bs, int64_t offset)
/* Write BAT entry to disk */
bat_offset = s->bat_offset + (4 * index);
bat_value = cpu_to_be32(s->pagetable[index]);
- ret = bdrv_pwrite_sync(bs->file, bat_offset, &bat_value, 4);
+ ret = bdrv_pwrite_sync(bs->file, bat_offset, &bat_value, 4, 0);
if (ret < 0)
goto fail;