From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHUej-0002EG-QN for qemu-devel@nongnu.org; Wed, 13 Aug 2014 05:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHUed-0003Ki-LF for qemu-devel@nongnu.org; Wed, 13 Aug 2014 05:15:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHUed-0003Jr-Ae for qemu-devel@nongnu.org; Wed, 13 Aug 2014 05:15:35 -0400 From: Markus Armbruster References: <1407854125-25068-1-git-send-email-danielhb@linux.vnet.ibm.com> Date: Wed, 13 Aug 2014 11:15:28 +0200 In-Reply-To: <1407854125-25068-1-git-send-email-danielhb@linux.vnet.ibm.com> (Daniel Henrique Barboza's message of "Tue, 12 Aug 2014 11:35:25 -0300") Message-ID: <871tsk698v.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] block.curl: adding 'curltimeout' option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Daniel Henrique Barboza Cc: Kevin Wolf , Qemu Devel , Stefan Hajnoczi Daniel Henrique Barboza writes: > The curl hardcoded timeout (5 seconds) sometimes is not long > enough depending on the remote server configuration and network > traffic. The user should be able to set how much long he is > willing to wait for the connection. > > Adding a new option to set this timeout gives the user this > flexibility. The previous default timeout of 5 seconds will be > used if this option is not present. > > Signed-off-by: Daniel Henrique Barboza > --- > block/curl.c | 13 ++++++++++++- > qemu-options.hx | 10 ++++++++-- > 2 files changed, 20 insertions(+), 3 deletions(-) > > diff --git a/block/curl.c b/block/curl.c > index 79ff2f1..a9e43f1 100644 > --- a/block/curl.c > +++ b/block/curl.c > @@ -63,6 +63,7 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, > #define CURL_NUM_ACB 8 > #define SECTOR_SIZE 512 > #define READ_AHEAD_DEFAULT (256 * 1024) > +#define CURL_TIMEOUT_DEFAULT 5 > > #define FIND_RET_NONE 0 > #define FIND_RET_OK 1 > @@ -71,6 +72,7 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, > #define CURL_BLOCK_OPT_URL "url" > #define CURL_BLOCK_OPT_READAHEAD "readahead" > #define CURL_BLOCK_OPT_SSLVERIFY "sslverify" > +#define CURL_BLOCK_OPT_TIMEOUT "curltimeout" To what could this timeout apply other than Curl? If nothing, then just "timeout", please. Else, "curl-timeout". > > struct BDRVCURLState; > > @@ -109,6 +111,7 @@ typedef struct BDRVCURLState { > char *url; > size_t readahead_size; > bool sslverify; > + int curltimeout; > bool accept_range; > AioContext *aio_context; > } BDRVCURLState; Likewise: either timeout, or curl_timeout. [...]