All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename
@ 2016-11-26 23:54 Max Reitz
  2016-11-28  6:50 ` Fam Zheng
  0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2016-11-26 23:54 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Jeff Cody, Kevin Wolf

Currently, the curl block driver will replace any URL specified through
the options QDict by a filename, if one has been given. However, the
options QDict should generally take precedence, which is implemented by
this patch.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
Not really critical, so getting this into 2.9 is sufficient.
---
 block/curl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/curl.c b/block/curl.c
index 0404c1b..2e9a45c 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -531,7 +531,9 @@ static void curl_clean_state(CURLState *s)
 static void curl_parse_filename(const char *filename, QDict *options,
                                 Error **errp)
 {
-    qdict_put(options, CURL_BLOCK_OPT_URL, qstring_from_str(filename));
+    if (!qdict_haskey(options, CURL_BLOCK_OPT_URL)) {
+        qdict_put(options, CURL_BLOCK_OPT_URL, qstring_from_str(filename));
+    }
 }
 
 static void curl_detach_aio_context(BlockDriverState *bs)
-- 
2.10.2

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

end of thread, other threads:[~2016-11-28  6:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-26 23:54 [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename Max Reitz
2016-11-28  6:50 ` Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.