diff options
Diffstat (limited to 'block/vhdx.c')
-rw-r--r-- | block/vhdx.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/block/vhdx.c b/block/vhdx.c index 68db9e074e..9918ee98ff 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -898,6 +898,12 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, uint64_t signature; Error *local_err = NULL; + bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, + false, errp); + if (!bs->file) { + return -EINVAL; + } + s->bat = NULL; s->first_visible_write = true; @@ -1165,7 +1171,7 @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s, /* per the spec, the address for a block is in units of 1MB */ *new_offset = ROUND_UP(*new_offset, 1024 * 1024); - return bdrv_truncate(bs->file->bs, *new_offset + s->block_size); + return bdrv_truncate(bs->file, *new_offset + s->block_size); } /* |