From nobody Tue Nov 18 09:04:42 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608563913; cv=none; d=zohomail.com; s=zohoarc; b=E8ZPk/IZdD6Ac0CDcswPHl0HE81ECbcIYrfR9+ls165ixgXb27WjH8ANEPf8UswtL4Lze72dQqOvD4t5XDRoZlqU7BKVbDC8FBKsGdjTBvVQFmm8yYHlAZhMWR26tH2eXOQbI2yyXynffD4pojcru82xikC9LmtrjP2vMidl0Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608563913; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IUehFNl6rhfyT37c92sSKWNXxAmQ4tNlj0djWzXh9wE=; b=QS+GY+XKYafdJ2N5S3MAiKZNZGv8MJ1nQR45/JsaN1s5Xmq3cggJH7UcU17bb+EMm0y9OMkGBzqyELOBq0fQMO6gPTaVriLmr6ooOwQGAPfhvQ4VwnuMVIokGDyykgONkLUvOD9Klt7c9N0MY8s+3xwYHkOzyxdEs6mUia7SmoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608563912546974.2207059115267; Mon, 21 Dec 2020 07:18:32 -0800 (PST) Received: from localhost ([::1]:41096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krMxC-0000PC-A6 for importer@patchew.org; Mon, 21 Dec 2020 10:18:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krMRD-0004rV-BA for qemu-devel@nongnu.org; Mon, 21 Dec 2020 09:45:31 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1krMR9-0007pB-S9 for qemu-devel@nongnu.org; Mon, 21 Dec 2020 09:45:26 -0500 Received: by mail-wr1-x42c.google.com with SMTP id t16so11330080wra.3 for ; Mon, 21 Dec 2020 06:45:23 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id l5sm27439627wrv.44.2020.12.21.06.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 06:45:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IUehFNl6rhfyT37c92sSKWNXxAmQ4tNlj0djWzXh9wE=; b=dGElYgncueoqFrBjxYK0bsHIMxkhbYq9as0oEtVij5xgY5lf94S8ZtOfX/agLudfpE PfGlH73STiagcZ7nglG841pqU6bT0sdUpRBpEJczBkxjZSrnHd6qiKXIg60q3CTfUlDD TXJ809A3E/+gZ6shxm5gF8zmvc9TSScXDuY3YKjC1oY54zrDMS/ZZ6gE2VwdDTaEZ9Yh /AcVEQA5EaTOU4f3kwyc1WD9rF3nKUaKSzZD3h/cbCMG7gR9GD7TqhcfTBOYFtvSwkEh omTZjSv3DwNtxhJ3B+EDgf+pemGBnR7FOjI1TZYgyP1y/MWAm5erfvheEDjzj3nvdgRN tCPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IUehFNl6rhfyT37c92sSKWNXxAmQ4tNlj0djWzXh9wE=; b=GGR40JzgVOkYRpuYYuPcuoK5s8yPHVcBETkM+mu6YOM4uKh43xyLxOEiuZJtnH4qPa 23c7JPOq8k9nDe7xIJn98fQ+L1yRGQdykh7BgvbuunW1yycgb+MU9spryPRgGZtEjffd xOOAyAJRE5zkQo1rQ+OHXh+n+QHYYPhFIMwt9s+l7NC/pxnrTMY96EGmK4g0UMe4V0+P n1RtqCuAt5VPn81FvgtfGxbwfnL90iTUzM8IrQuNFI6SHm0KzCkOp9vywcdCEQd7Eo5u ON7minzNHgIfVqa0UTzS+PQEc3irgBRUJ7XboN28Fp4NVcmsJt1ytTSIXpAPGeJNnqPw E0EQ== X-Gm-Message-State: AOAM531NmxCqlNy+DwMZUSepI18m1p4WuKGMAdz3imYG2TeludlR6MsT Ow/AH5FmUTIQBXZkTxSh/+h6R7hCx8w= X-Google-Smtp-Source: ABdhPJzzosY0tnTMjjc/TPKo2AKmH2WE9h/E0kmGN+9t6pWAT2a216Ypcu/0y0EJ86MlfYQ2gNDc/w== X-Received: by 2002:adf:e552:: with SMTP id z18mr19580774wrm.29.1608561922222; Mon, 21 Dec 2020 06:45:22 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 37/55] curl: remove compatibility code, require 7.29.0 Date: Mon, 21 Dec 2020 15:44:29 +0100 Message-Id: <20201221144447.26161-38-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201221144447.26161-1-pbonzini@redhat.com> References: <20201221144447.26161-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Daniel=20Berrang=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) cURL 7.16.0 was released in October 2006. Just remove code that is in all likelihood not being used anywhere, and require the oldest version found in currently supported distros, which is 7.29.0 from CentOS 7. pkg-config is enough for QEMU, since it does not need extra information such as the path for certicate authorities. All supported platforms today will all have pkg-config for curl, so we can drop curl-config. Suggested-by: Daniel Berrang=C3=A9 Reviewed-by: Daniel Berrang=C3=A9 Signed-off-by: Paolo Bonzini --- block/curl.c | 28 ---------------------------- configure | 9 ++------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/block/curl.c b/block/curl.c index d24a4c5897..4ff895df8f 100644 --- a/block/curl.c +++ b/block/curl.c @@ -37,26 +37,6 @@ =20 // #define DEBUG_VERBOSE =20 -#if LIBCURL_VERSION_NUM >=3D 0x071000 -/* The multi interface timer callback was introduced in 7.16.0 */ -#define NEED_CURL_TIMER_CALLBACK -#define HAVE_SOCKET_ACTION -#endif - -#ifndef HAVE_SOCKET_ACTION -/* If curl_multi_socket_action isn't available, define it statically here = in - * terms of curl_multi_socket. Note that ev_bitmask will be ignored, which= is - * less efficient but still safe. */ -static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, - curl_socket_t sockfd, - int ev_bitmask, - int *running_handles) -{ - return curl_multi_socket(multi_handle, sockfd, running_handles); -} -#define curl_multi_socket_action __curl_multi_socket_action -#endif - #define PROTOCOLS (CURLPROTO_HTTP | CURLPROTO_HTTPS | \ CURLPROTO_FTP | CURLPROTO_FTPS) =20 @@ -140,7 +120,6 @@ typedef struct BDRVCURLState { static void curl_clean_state(CURLState *s); static void curl_multi_do(void *arg); =20 -#ifdef NEED_CURL_TIMER_CALLBACK /* Called from curl_multi_do_locked, with s->mutex held. */ static int curl_timer_cb(CURLM *multi, long timeout_ms, void *opaque) { @@ -156,7 +135,6 @@ static int curl_timer_cb(CURLM *multi, long timeout_ms,= void *opaque) } return 0; } -#endif =20 /* Called from curl_multi_do_locked, with s->mutex held. */ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, @@ -433,7 +411,6 @@ static void curl_multi_do(void *arg) =20 static void curl_multi_timeout_do(void *arg) { -#ifdef NEED_CURL_TIMER_CALLBACK BDRVCURLState *s =3D (BDRVCURLState *)arg; int running; =20 @@ -446,9 +423,6 @@ static void curl_multi_timeout_do(void *arg) =20 curl_multi_check_completion(s); qemu_mutex_unlock(&s->mutex); -#else - abort(); -#endif } =20 /* Called with s->mutex held. */ @@ -598,10 +572,8 @@ static void curl_attach_aio_context(BlockDriverState *= bs, s->multi =3D curl_multi_init(); s->aio_context =3D new_context; curl_multi_setopt(s->multi, CURLMOPT_SOCKETFUNCTION, curl_sock_cb); -#ifdef NEED_CURL_TIMER_CALLBACK curl_multi_setopt(s->multi, CURLMOPT_TIMERDATA, s); curl_multi_setopt(s->multi, CURLMOPT_TIMERFUNCTION, curl_timer_cb); -#endif } =20 static QemuOptsList runtime_opts =3D { diff --git a/configure b/configure index 8dd9c33685..c75196beb1 100755 --- a/configure +++ b/configure @@ -3426,17 +3426,12 @@ done ########################################## # curl probe if test "$curl" !=3D "no" ; then - if $pkg_config libcurl --exists; then - curlconfig=3D"$pkg_config libcurl" - else - curlconfig=3Dcurl-config - fi cat > $TMPC << EOF #include int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } EOF - curl_cflags=3D$($curlconfig --cflags 2>/dev/null) - curl_libs=3D$($curlconfig --libs 2>/dev/null) + curl_cflags=3D$($pkg_config libcurl --cflags 2>/dev/null) + curl_libs=3D$($pkg_config libcurl --libs 2>/dev/null) if compile_prog "$curl_cflags" "$curl_libs" ; then curl=3Dyes else --=20 2.29.2