From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBFmG-0006RS-AK for qemu-devel@nongnu.org; Mon, 28 Nov 2016 01:51:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBFmF-000364-Iv for qemu-devel@nongnu.org; Mon, 28 Nov 2016 01:51:00 -0500 Date: Mon, 28 Nov 2016 14:50:48 +0800 From: Fam Zheng Message-ID: <20161128065048.GA23163@lemon.cpc> References: <20161126235405.1357-1-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161126235405.1357-1-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.9] block/curl: Prefer URL in options over filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org 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 > --- > 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