qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: don't add 'driver' to options when refering to backing via node name
@ 2017-10-12 14:14 Peter Krempa
  2017-10-17 14:41 ` Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Krempa @ 2017-10-12 14:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Max Reitz, qemu-block, Peter Krempa

When refering to a backing file of an image via node name
bdrv_open_backing_file would add the 'driver' option to the option list
filling it with the backing format driver. This breaks construction of
the backing chain via -blockdev, as bdrv_open_inherit reports an error
if both 'reference' and 'options' are provided.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 46eb1728da..684cb018da 100644
--- a/block.c
+++ b/block.c
@@ -2245,7 +2245,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
         goto free_exit;
     }

-    if (bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) {
+    if (!reference &&
+        bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) {
         qdict_put_str(options, "driver", bs->backing_format);
     }

-- 
2.14.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-17 21:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-12 14:14 [Qemu-devel] [PATCH] block: don't add 'driver' to options when refering to backing via node name Peter Krempa
2017-10-17 14:41 ` Kevin Wolf
2017-10-17 14:44   ` Peter Krempa
2017-10-17 15:11 ` [Qemu-devel] [PATCH 2/1] qemu-iotests: Test backing_fmt with backing node reference Kevin Wolf
2017-10-17 15:16   ` Kevin Wolf
2017-10-17 21:44     ` Eric Blake
2017-10-17 21:41 ` [Qemu-devel] [PATCH] block: don't add 'driver' to options when refering to backing via node name Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).