From nobody Tue May 7 20:05:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) client-ip=205.139.111.44; envelope-from=libvir-list-bounces@listman.redhat.com; helo=us-smtp-delivery-44.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613547417; cv=none; d=zohomail.com; s=zohoarc; b=RyH8jh8UFzYIkS9iE9OCUhtxIoXieqxDJvrpjuthwzA373Tu6aQBkeclOPDQMA9eHyN1k5Zm2wuqdD0B/9kNI4pjljLXLeOJs4M5DablyqXE9sTeVmqtKc+dncZkiBpS86Cb9PzvM/6A3PFXKeTm12PNWKNgOulvZgboaaUVAW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613547417; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2PnZuksM8JRRruyZ6v/dZWcrpvVP3lB7qQPAWYkdLQI=; b=X78664NaH7r9IyqRKNE9w5kK1JAlDjxlDf/97FAX1JJ7ibgLrNYfjQSkaYT9XWPRCZ5TAvVhDXNJrASU4NE/mNtavGeusuciUPuWLXupPPchRoAvCCBRRNiiCtfObBGaLogZRBqe0LcfBIlT6lZdVQy3Lt3ebKUbS6Lp8febOkY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by mx.zohomail.com with SMTPS id 1613547417590925.4231464447065; Tue, 16 Feb 2021 23:36:57 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-813zJUQgNsq2t_w8NnkN1g-1; Wed, 17 Feb 2021 02:36:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC6666D4E3; Wed, 17 Feb 2021 07:36:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC69E60843; Wed, 17 Feb 2021 07:36:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 85E1518095CB; Wed, 17 Feb 2021 07:36:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11H7aaQK012525 for ; Wed, 17 Feb 2021 02:36:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2CF3F19D9F; Wed, 17 Feb 2021 07:36:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id A230C17B30 for ; Wed, 17 Feb 2021 07:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613547416; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2PnZuksM8JRRruyZ6v/dZWcrpvVP3lB7qQPAWYkdLQI=; b=TPWxY1fS9sEw9j+aFwFJIDt0EVL7fgrr6liN9mb1UIFZGvdt187qGb2TgsZ4UNfyvKdv79 sa6OkI5VWQFmg2pIC4qcg5hQeDggVR1NQxr0j8XVPcIpAm0RRkD5XNsBTJQR7VnmhzMdi+ 4bzQuTBCfYC5HalLM6uITXEyEBEm2UY= X-MC-Unique: 813zJUQgNsq2t_w8NnkN1g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] esx: Bump minimal version of curl Date: Wed, 17 Feb 2021 08:36:27 +0100 Message-Id: <31c27271cc5770fe0960cc829d119f7f69760f7d.1613547247.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@listman.redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@listman.redhat.com Errors-To: libvir-list-bounces@listman.redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@listman.redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: listman.redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" According to meson.build the minimal version of curl needed is 7.18.0 which was released in January 2008. If the minimal version is bumped to 7.19.1 (released in November 2008) we can drop some workarounds because this newer version provides APIs we need. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- Since the new version is still ~12 years old, I did not check whether it is available in all supported distros. If it isn't then we should re-evaluate support of running libvirt from git on that distro. meson.build | 2 +- src/esx/esx_stream.c | 8 -------- src/esx/esx_vi.c | 7 ------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 766bc06b61..369548f127 100644 --- a/meson.build +++ b/meson.build @@ -1001,7 +1001,7 @@ if capng_dep.found() conf.set('WITH_CAPNG', 1) endif =20 -curl_version =3D '7.18.0' +curl_version =3D '7.19.1' curl_dep =3D dependency('libcurl', version: '>=3D' + curl_version, require= d: get_option('curl')) if curl_dep.found() # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version diff --git a/src/esx/esx_stream.c b/src/esx/esx_stream.c index 131fbc100b..e4e67a01bb 100644 --- a/src/esx/esx_stream.c +++ b/src/esx/esx_stream.c @@ -396,7 +396,6 @@ esxStreamOpen(virStreamPtr stream, esxPrivate *priv, co= nst char *url, int result =3D -1; esxStreamPrivate *streamPriv; g_autofree char *range =3D NULL; - g_autofree char *userpwd =3D NULL; esxVI_MultiCURL *multi =3D NULL; =20 /* FIXME: Although there is already some code in place to deal with @@ -438,17 +437,10 @@ esxStreamOpen(virStreamPtr stream, esxPrivate *priv, = const char *url, curl_easy_setopt(streamPriv->curl->handle, CURLOPT_URL, url); curl_easy_setopt(streamPriv->curl->handle, CURLOPT_RANGE, range); =20 -#if LIBCURL_VERSION_NUM >=3D 0x071301 /* 7.19.1 */ curl_easy_setopt(streamPriv->curl->handle, CURLOPT_USERNAME, priv->primary->username); curl_easy_setopt(streamPriv->curl->handle, CURLOPT_PASSWORD, priv->primary->password); -#else - userpwd =3D g_strdup_printf("%s:%s", priv->primary->username, - priv->primary->password); - - curl_easy_setopt(streamPriv->curl->handle, CURLOPT_USERPWD, userpwd); -#endif =20 if (esxVI_MultiCURL_Alloc(&multi) < 0 || esxVI_MultiCURL_Add(multi, streamPriv->curl) < 0) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index e1c1a15ab6..e535b28484 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -230,9 +230,7 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url) { CURLcode errorCode; long responseCode =3D 0; -#if LIBCURL_VERSION_NUM >=3D 0x071202 /* 7.18.2 */ const char *redirectUrl =3D NULL; -#endif =20 errorCode =3D curl_easy_perform(curl->handle); =20 @@ -262,7 +260,6 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url) } =20 if (responseCode =3D=3D 301) { -#if LIBCURL_VERSION_NUM >=3D 0x071202 /* 7.18.2 */ errorCode =3D curl_easy_getinfo(curl->handle, CURLINFO_REDIRECT_UR= L, &redirectUrl); =20 @@ -277,10 +274,6 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url) _("The server redirects from '%s' to '%s'"), ur= l, redirectUrl); } -#else - virReportError(VIR_ERR_INTERNAL_ERROR, - _("The server redirects from '%s'"), url); -#endif =20 return -1; } --=20 2.26.2