From nobody Mon Feb 2 06:00:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769451172; cv=none; d=zohomail.com; s=zohoarc; b=ASXJWc5OQWpOnuigd5Wwh/bKR5ED7uqajDfKWoBD/prhWwBETWmZJsMaqBUZB4f28v38i7D/Mr01aG5TnmjWbbba6o6bOcMP7+T6LuhmBFwMpPGDWB18QyNTWZdaCAa5b9/GoUDe+syxS6fxjpz7T+xH56lOgsNdL8hPHcJTMn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769451172; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=01XahbHtgnGR4z33JkoNvSCgV4iNtSahQvTmGbktgOg=; b=dR3f+qbiJUhrVOJgBPwkZyvtAvrcayhTRRarWmT1LoYKRPQgDwbzgDWbKxfq4dpnQC6bpSXEkYof8zAowVfX5CVF6Q1uFaPNs6yr/TgXYGjaA1KJ1IYXuWHuCxCMcxFUUdDlAOnojabl/kpEn7D2pq4JyM1OuTKSNTDRDPKJvx8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769451172357503.9239345294328; Mon, 26 Jan 2026 10:12:52 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6CC6F41942; Mon, 26 Jan 2026 13:12:51 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8918641C1A; Mon, 26 Jan 2026 13:11:28 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 9540C41950; Mon, 26 Jan 2026 13:11:24 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1F5E04193F for ; Mon, 26 Jan 2026 13:11:24 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-TIvypik4NLCdxSIjMsH-5g-1; Mon, 26 Jan 2026 13:11:22 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 88D211955DB3 for ; Mon, 26 Jan 2026 18:11:21 +0000 (UTC) Received: from dosh.home.annexia.org.com (unknown [10.44.32.24]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2B05F180066A; Mon, 26 Jan 2026 18:11:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769451083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=01XahbHtgnGR4z33JkoNvSCgV4iNtSahQvTmGbktgOg=; b=VOKkAX2Yra539+XxT34MxZuAKuS/Seig6NnF6HGzJuBCqgoH0pJjJwndDVnNDO6EYsZgey +0AP+0I2Wc/FeSh08GeRrvVtTdtzTcY4I/Ivnzgqke5oz8Dr5jYP0JAu5ho4ryQ0GyoUyD hnDd2j3XNGo5v4LPabltkDOancpmPxc= X-MC-Unique: TIvypik4NLCdxSIjMsH-5g-1 X-Mimecast-MFC-AGG-ID: TIvypik4NLCdxSIjMsH-5g_1769451081 To: devel@lists.libvirt.org Subject: [PATCH v3 1/3] esx: Debug URL just before opening with curl Date: Mon, 26 Jan 2026 18:09:57 +0000 Message-ID: <20260126181115.1832646-2-rjones@redhat.com> In-Reply-To: <20260126181115.1832646-1-rjones@redhat.com> References: <20260126181115.1832646-1-rjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 24TCBYWdMwStdeOdmRDu-WzAuqj2bN5F-swNW74NwZc_1769451081 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: C3Y3PPVBH4KQKHYSDJLUUZK2XLSGDMMQ X-Message-ID-Hash: C3Y3PPVBH4KQKHYSDJLUUZK2XLSGDMMQ X-MailFrom: rjones@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: mprivozn@redhat.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Richard W.M. Jones via Devel" Reply-To: "Richard W.M. Jones" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769451176858154100 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Richard W.M. Jones Reviewed-by: Daniel P. Berrang=C3=A9 --- src/esx/esx_vi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 3264afc13a..8d2ffb3f8f 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -231,6 +231,8 @@ esxVI_CURL_Perform(esxVI_CURL *curl, const char *url) long responseCode =3D 0; const char *redirectUrl =3D NULL; =20 + VIR_DEBUG("URL: %s", url); + errorCode =3D curl_easy_perform(curl->handle); =20 if (errorCode !=3D CURLE_OK) { --=20 2.52.0 From nobody Mon Feb 2 06:00:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769451215; cv=none; d=zohomail.com; s=zohoarc; b=j4FCLE747FWHs5V3NAITTIeFDibUqP7IVq5ULY/WY1jxCLenE0gJsdovGNHNS745B7wnyqOlUWBfynMS6KZ9NunzOn+heYeeonIpPU9xvAPNhGXcJ8RgtRsHx6Iwbf5obFXGnaBGsJieRg/h9XOLKNcuSQQgFpR5mxhOdqbwFKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769451215; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=Ph0QSi6yc42b/WqGvbAVuaUlBylZCglZL2jQF+rNYUk=; b=NQInGk0BEKVIwyjiEMWsTkJqDTzqHLwaFopQ2TmUlMpuwokZXi4eK9JbPB4jmLxVkmjdE7PwzUeDFw3I6a7nCijzbZ/y1na9n+LjRIvDatFNbSd3FiytdqnjPhy66S6LRONW5qtL9Afi6AZq5OriSwdGaJ8HP9ie7frAZO9RVWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769451214997153.5848976471584; Mon, 26 Jan 2026 10:13:34 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id C72E741B94; Mon, 26 Jan 2026 13:13:34 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5B56743E37; Mon, 26 Jan 2026 13:11:45 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id C77CF41B1A; Mon, 26 Jan 2026 13:11:41 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 3772341AC6 for ; Mon, 26 Jan 2026 13:11:26 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-uxR-th54PbSjJoZYYYQ8QA-1; Mon, 26 Jan 2026 13:11:24 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5A8931800365 for ; Mon, 26 Jan 2026 18:11:23 +0000 (UTC) Received: from dosh.home.annexia.org.com (unknown [10.44.32.24]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0FC2E1800240; Mon, 26 Jan 2026 18:11:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769451085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ph0QSi6yc42b/WqGvbAVuaUlBylZCglZL2jQF+rNYUk=; b=AisUycSGaxHdEdX4tpo1He5N60R5km2O2iICQE8QTLp0606WPm5JfyDOIPwwYxNt6yq79o BNhbXV8GMipY76P6famuef/SckB8sr3N+yvqfTbbyudAbTXFwALomcgCdu1eMuuqA+id5t wpAo5NX7IvOmkTk6tMZdX9RdRcCG8V4= X-MC-Unique: uxR-th54PbSjJoZYYYQ8QA-1 X-Mimecast-MFC-AGG-ID: uxR-th54PbSjJoZYYYQ8QA_1769451083 To: devel@lists.libvirt.org Subject: [PATCH v3 2/3] esx: Abstract all URL-creation code into one function Date: Mon, 26 Jan 2026 18:09:58 +0000 Message-ID: <20260126181115.1832646-3-rjones@redhat.com> In-Reply-To: <20260126181115.1832646-1-rjones@redhat.com> References: <20260126181115.1832646-1-rjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Yw5Sl2oQN_buVXGOC92obPVlv-5RvY5ol2AX3MHZKcU_1769451083 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5TLCWSRVHLDLN3W4CRSEQ54WJVN45RSP X-Message-ID-Hash: 5TLCWSRVHLDLN3W4CRSEQ54WJVN45RSP X-MailFrom: rjones@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: mprivozn@redhat.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Richard W.M. Jones via Devel" Reply-To: "Richard W.M. Jones" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769451240437158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Abstract the places where we create URLs into one place. This is just refactoring and should not change the behaviour. Signed-off-by: Richard W.M. Jones Reviewed-by: Daniel P. Berrang=C3=A9 --- src/esx/esx_driver.c | 53 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 02f30c2b19..8fdfe0a656 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -582,7 +582,37 @@ esxCapsInit(esxPrivate *priv) return NULL; } =20 +static char * +esxCreateURL(const char *transport, + const char *server, + int port, + const char *path) +{ + char *url; =20 + url =3D g_strdup_printf("%s://%s:%d%s", + transport, + server, + port, + path); + return url; +} + +/* + * Same as above, but add it to a buffer because the calling code will + * append query strings etc. + */ +static void +esxCreateURLBuffer(virBuffer *buffer, + const char *transport, + const char *server, + int port, + const char *path) +{ + g_autofree char *url =3D esxCreateURL(transport, server, port, path); + + virBufferAdd(buffer, url, strlen(url)); +} =20 static int esxConnectToHost(esxPrivate *priv, @@ -619,8 +649,8 @@ esxConnectToHost(esxPrivate *priv, conn->uri->server))) goto cleanup; =20 - url =3D g_strdup_printf("%s://%s:%d/sdk", priv->parsedUri->transport, - conn->uri->server, conn->uri->port); + url =3D esxCreateURL(priv->parsedUri->transport, + conn->uri->server, conn->uri->port, "/sdk"); =20 if (esxVI_Context_Alloc(&priv->host) < 0 || esxVI_Context_Connect(priv->host, url, ipAddress, username, passwo= rd, @@ -706,8 +736,8 @@ esxConnectToVCenter(esxPrivate *priv, if (!(password =3D virAuthGetPassword(conn, auth, "esx", username, hos= tname))) return -1; =20 - url =3D g_strdup_printf("%s://%s:%d/sdk", priv->parsedUri->transport, = hostname, - conn->uri->port); + url =3D esxCreateURL(priv->parsedUri->transport, hostname, + conn->uri->port, "/sdk"); =20 if (esxVI_Context_Alloc(&priv->vCenter) < 0 || esxVI_Context_Connect(priv->vCenter, url, ipAddress, username, @@ -2357,8 +2387,9 @@ esxDomainScreenshot(virDomainPtr domain, virStreamPtr= stream, } =20 /* Build URL */ - virBufferAsprintf(&buffer, "%s://%s:%d/screen?id=3D", priv->parsedUri-= >transport, - domain->conn->uri->server, domain->conn->uri->port); + esxCreateURLBuffer(&buffer, priv->parsedUri->transport, + domain->conn->uri->server, domain->conn->uri->port, + "/screen?id=3D"); virBufferURIEncodeString(&buffer, virtualMachine->obj->value); =20 url =3D virBufferContentAndReset(&buffer); @@ -2563,8 +2594,9 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int= flags) goto cleanup; } =20 - virBufferAsprintf(&buffer, "%s://%s:%d/folder/", priv->parsedUri->tran= sport, - domain->conn->uri->server, domain->conn->uri->port); + esxCreateURLBuffer(&buffer, priv->parsedUri->transport, + domain->conn->uri->server, domain->conn->uri->port, + "/folder/"); virBufferURIEncodeString(&buffer, directoryAndFileName); virBufferAddLit(&buffer, "?dcPath=3D"); esxUtil_EscapeInventoryObject(&buffer, priv->primary->datacenterPath); @@ -2987,8 +3019,9 @@ esxDomainDefineXMLFlags(virConnectPtr conn, const cha= r *xml, unsigned int flags) goto cleanup; } =20 - virBufferAsprintf(&buffer, "%s://%s:%d/folder/", priv->parsedUri->tran= sport, - conn->uri->server, conn->uri->port); + esxCreateURLBuffer(&buffer, priv->parsedUri->transport, + conn->uri->server, conn->uri->port, + "/folder/"); =20 if (directoryName) { virBufferURIEncodeString(&buffer, directoryName); --=20 2.52.0 From nobody Mon Feb 2 06:00:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769451264; cv=none; d=zohomail.com; s=zohoarc; b=F+ofDSEhOcK6WGwF8mjGGfY4q1Whx0rtvQtk9r3mhRL+vjUafsnHJP9jezncD5nDbz29bok3lnHQ9dzDubP6seeW8BmV3IQCdhVpAfVgJASfiWVNTBk60HfN5LT4r/XrCN+y/VahRXRG9O0CjnJlxM4FmG6QgJVPPBD/RWI3LkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769451264; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=HOh/X2bqb3E0PqJ53geDZrQlT9ThE3Fu7swl4XxsYIs=; b=c3Xzs6dTBWxO9EOlfRbWlWM6Tsx6uA2myCsOf7qokMslAcngeL0KIl+NfG/lKBwoVmQk2uFnQvH9x40D2V5oWYO9G45Diy4oJMfB7uRYIc3RlkegI5Zgr9+B5KJ0gpLKc3/NUPdIiaGqHGUWyQAKkjvJXW1db8aweU16KJmMQoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769451264232417.7987881333112; Mon, 26 Jan 2026 10:14:24 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4877041942; Mon, 26 Jan 2026 13:14:23 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 527EF41C87; Mon, 26 Jan 2026 13:12:45 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id B870F41A35; Mon, 26 Jan 2026 13:12:40 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 445AA43DC2 for ; Mon, 26 Jan 2026 13:11:28 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-426-iDIRTWonNGeAodoxGOPsNg-1; Mon, 26 Jan 2026 13:11:25 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 29B1A1944F2F for ; Mon, 26 Jan 2026 18:11:25 +0000 (UTC) Received: from dosh.home.annexia.org.com (unknown [10.44.32.24]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D11EE18001D5; Mon, 26 Jan 2026 18:11:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769451087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HOh/X2bqb3E0PqJ53geDZrQlT9ThE3Fu7swl4XxsYIs=; b=e3I+BlBm0OY6UwOVZ5eXKkZVNAOilZrSb0z45JRAPZ5VjuyN4TaPewbnwYXnF4sheovlFW bELV5hxbHV1WHsyJ9zbRSkqOmj9YIma71DY41j4dUftS/iv3vmd/bDNV7DaLtUQ3823VNa 9pwsoi2PXV55Yjgz60PIyiO9lZQ5COE= X-MC-Unique: iDIRTWonNGeAodoxGOPsNg-1 X-Mimecast-MFC-AGG-ID: iDIRTWonNGeAodoxGOPsNg_1769451085 To: devel@lists.libvirt.org Subject: [PATCH v3 3/3] esx: Switch to creating URLs using virURIFormat Date: Mon, 26 Jan 2026 18:09:59 +0000 Message-ID: <20260126181115.1832646-4-rjones@redhat.com> In-Reply-To: <20260126181115.1832646-1-rjones@redhat.com> References: <20260126181115.1832646-1-rjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: VVEbR6IWgZeaXWnwP9S5jUSArZxABlJbfdhrWqXhCQo_1769451085 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: S3QASRQ5LIQH6VCZ4SGHK2IOIVVL75MI X-Message-ID-Hash: S3QASRQ5LIQH6VCZ4SGHK2IOIVVL75MI X-MailFrom: rjones@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: mprivozn@redhat.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Richard W.M. Jones via Devel" Reply-To: "Richard W.M. Jones" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769451266945158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Since libvirt has existing support for creating URIs, use that rather than home-rolling our own code without any escaping. As a side-effect this ensures that URLs containing IPv6 addresses are escaped correctly, for example as below (note square brackets): https://[1234:56:0:789a:bcde:72ff:fe0a:7baa]:443/sdk Fixes: https://issues.redhat.com/browse/RHEL-138300 Updates: commit 845210011a9ffd9d17e30c51cbc81ba67c5d3166 Reported-by: Ming Xie Signed-off-by: Richard W.M. Jones Reviewed-by: Daniel P. Berrang=C3=A9 --- src/esx/esx_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8fdfe0a656..9f8aae52bd 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -588,14 +588,14 @@ esxCreateURL(const char *transport, int port, const char *path) { - char *url; + virURI uri =3D { + .scheme =3D (char*)transport, + .server =3D (char*)server, + .port =3D port, + .path =3D (char*)path, + }; =20 - url =3D g_strdup_printf("%s://%s:%d%s", - transport, - server, - port, - path); - return url; + return virURIFormat(&uri); } =20 /* --=20 2.52.0