summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf2013-04-12 20:27:07 +0200
committerKevin Wolf2013-04-22 11:37:12 +0200
commit1cb6f506444ddf00bb163e5ffa28ab1051b65642 (patch)
tree9b7339e0c47e76046ce1da446060b7feea489e85 /block.c
parentblock: Remove filename parameter from .bdrv_file_open() (diff)
downloadqemu-1cb6f506444ddf00bb163e5ffa28ab1051b65642.tar.gz
qemu-1cb6f506444ddf00bb163e5ffa28ab1051b65642.tar.xz
qemu-1cb6f506444ddf00bb163e5ffa28ab1051b65642.zip
block: Allow overriding backing.file.filename
If a filename is passed in the driver-specific options from the command line, the backing file path from the image is ignored now. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block.c b/block.c
index 6e07f4572b..819eb4e009 100644
--- a/block.c
+++ b/block.c
@@ -889,7 +889,9 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options)
}
bs->open_flags &= ~BDRV_O_NO_BACKING;
- if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) {
+ if (qdict_haskey(options, "file.filename")) {
+ backing_filename[0] = '\0';
+ } else if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) {
QDECREF(options);
return 0;
}