aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block.c b/block.c
index 7330a87..e7387f1 100644
--- a/block.c
+++ b/block.c
@@ -1017,7 +1017,12 @@ static int bdrv_file_open(BlockDriverState *bs, const char *filename,
ret = -EINVAL;
goto fail;
}
- qdict_del(*options, "filename");
+
+ if (!drv->bdrv_needs_filename) {
+ qdict_del(*options, "filename");
+ } else {
+ filename = qdict_get_str(*options, "filename");
+ }
}
if (!drv->bdrv_file_open) {