]> git.proxmox.com Git - qemu.git/commitdiff
block: Allow overriding backing.file.filename
authorKevin Wolf <kwolf@redhat.com>
Fri, 12 Apr 2013 18:27:07 +0000 (20:27 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 22 Apr 2013 09:37:12 +0000 (11:37 +0200)
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>
block.c

diff --git a/block.c b/block.c
index 6e07f4572b915d05ecec0651ff6238f57106ca6d..819eb4e009243708f756aa7192cec1ff9bc96aa0 100644 (file)
--- 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;
     }