qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename
Date: Mon, 28 Nov 2016 14:50:48 +0800	[thread overview]
Message-ID: <20161128065048.GA23163@lemon.cpc> (raw)
In-Reply-To: <20161126235405.1357-1-mreitz@redhat.com>

On Sun, 11/27 00:54, Max Reitz wrote:
> 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
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

      reply	other threads:[~2016-11-28  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=20161128065048.GA23163@lemon.cpc \
    --to=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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).