qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH trivial v2] block/curl: drop old/unuspported curl version checks
@ 2025-08-25  9:58 Michael Tokarev
  2025-08-26 10:20 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2025-08-25  9:58 UTC (permalink / raw)
  To: qemu-devel, qemu-block, qemu-trivial; +Cc: Michael Tokarev

We currently require libcurl >=7.29.0 (since f9cd86fe72be3cd8).
Drop older LIBCURL_VERSION_NUM checks from the driver.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
v2: drop the right #if/#else block, thank you Marcus!

 block/curl.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/block/curl.c b/block/curl.c
index 00b949ea45..e0f98e035a 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -516,7 +516,7 @@ static int curl_init_state(BDRVCURLState *s, CURLState *state)
                              CURLOPT_REDIR_PROTOCOLS_STR, PROTOCOLS)) {
             goto err;
         }
-#elif LIBCURL_VERSION_NUM >= 0x071304
+#else
         if (curl_easy_setopt(state->curl, CURLOPT_PROTOCOLS, PROTOCOLS) ||
             curl_easy_setopt(state->curl, CURLOPT_REDIR_PROTOCOLS, PROTOCOLS)) {
             goto err;
@@ -821,22 +821,11 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
         goto out;
     }
 #endif
-    /* Prior CURL 7.19.4 return value of 0 could mean that the file size is not
-     * know or the size is zero. From 7.19.4 CURL returns -1 if size is not
-     * known and zero if it is really zero-length file. */
-#if LIBCURL_VERSION_NUM >= 0x071304
     if (cl < 0) {
         pstrcpy(state->errmsg, CURL_ERROR_SIZE,
                 "Server didn't report file size.");
         goto out;
     }
-#else
-    if (cl <= 0) {
-        pstrcpy(state->errmsg, CURL_ERROR_SIZE,
-                "Unknown file size or zero-length file.");
-        goto out;
-    }
-#endif
 
     s->len = cl;
 
-- 
2.47.2



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

* Re: [PATCH trivial v2] block/curl: drop old/unuspported curl version checks
  2025-08-25  9:58 [PATCH trivial v2] block/curl: drop old/unuspported curl version checks Michael Tokarev
@ 2025-08-26 10:20 ` Daniel P. Berrangé
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2025-08-26 10:20 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel, qemu-block, qemu-trivial

On Mon, Aug 25, 2025 at 12:58:04PM +0300, Michael Tokarev wrote:
> We currently require libcurl >=7.29.0 (since f9cd86fe72be3cd8).
> Drop older LIBCURL_VERSION_NUM checks from the driver.
> 
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> v2: drop the right #if/#else block, thank you Marcus!
> 
>  block/curl.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

end of thread, other threads:[~2025-08-26 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25  9:58 [PATCH trivial v2] block/curl: drop old/unuspported curl version checks Michael Tokarev
2025-08-26 10:20 ` Daniel P. Berrangé

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).