summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2013-12-20 19:28:09 +0100
committerKevin Wolf <kwolf@redhat.com>2014-01-22 12:07:17 +0100
commit2258e3fe20990a13c9aa2c1adccafae073b7ce13 (patch)
treeface552eae5e89ef3323a4d20a081d144b22899a
parent72daa72eeecb6b2ee06ab7d836ac3aa01ad7e6df (diff)
downloadqemu-2258e3fe20990a13c9aa2c1adccafae073b7ce13.zip
block: Pass reference to bdrv_file_open()
With that now being possible, bdrv_open() should try to extract a block device reference from the options and pass it to bdrv_file_open(). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block.c b/block.c
index 1e53b3dffd..bef4f8232b 100644
--- a/block.c
+++ b/block.c
@@ -1056,6 +1056,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options,
char tmp_filename[PATH_MAX + 1];
BlockDriverState *file = NULL;
QDict *file_options = NULL;
+ const char *file_reference;
const char *drvname;
Error *local_err = NULL;
@@ -1142,9 +1143,11 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options,
}
qdict_extract_subqdict(options, &file_options, "file.");
+ file_reference = qdict_get_try_str(options, "file");
- ret = bdrv_file_open(&file, filename, NULL, file_options,
+ ret = bdrv_file_open(&file, filename, file_reference, file_options,
bdrv_open_flags(bs, flags | BDRV_O_UNMAP), &local_err);
+ qdict_del(options, "file");
if (ret < 0) {
goto fail;
}