qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Jeff Cody <jcody@redhat.com>, Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename
Date: Sun, 27 Nov 2016 00:54:05 +0100	[thread overview]
Message-ID: <20161126235405.1357-1-mreitz@redhat.com> (raw)

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

             reply	other threads:[~2016-11-26 23:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26 23:54 Max Reitz [this message]
2016-11-28  6:50 ` [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161126235405.1357-1-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).