From nobody Fri Dec 19 20:16:12 2025 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=1744122709; cv=none; d=zohomail.com; s=zohoarc; b=iNiKKldE4SGlTeUS7oN06sl0Z5ILWkl3GWa1iOheV6M7toEQj4jTPnCDwkjDzfe5ye6qQYZdX9A7TZbhUhHUTMNNTzUN22UWWlJC+q375XHh/y6XeJ37vlt1I0oHT7KgqDAURPDfduYQKfD4V2VMsfZ66KA0XNcqbfKglXdbKRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744122709; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id; bh=dVgwWR06FQB1fTkSbirMYoj3x8etHHBhIL8f/schz/o=; b=bw2p7a1rCXFNB5cuChf0md6aF7ZBd/bGwiLkdbdhE43lzEIRzFZgfdI2GwQPve3VEr51se+tD3ZeV5Yi57duCwRLIk/mKNNg120EF/cxtHOzCbaiENhCwTdDoyN5nA0bEIOhz0QEdb+pgk/wVkLIfRFg4Dfn5Rsm8Q+3L6FHwdk= 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 1744122709238573.9704129809381; Tue, 8 Apr 2025 07:31:49 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7B8291519; Tue, 8 Apr 2025 10:31:37 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id A5C9B1520; Tue, 8 Apr 2025 10:31:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1A944966; Tue, 8 Apr 2025 10:31:17 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A80B395E for ; Tue, 8 Apr 2025 10:31:16 -0400 (EDT) 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-281-rfGT0wC3OBq1jG5eqvF4dQ-1; Tue, 08 Apr 2025 10:31:09 -0400 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 CDD1D18001E3 for ; Tue, 8 Apr 2025 14:31:08 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.8]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB6CA18089B2; Tue, 8 Apr 2025 14:31:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744122676; 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; bh=n3ykMK0wgxUNKnVrIiqH3bbeP/wv0HF1UXzJXlOVyVI=; b=PnK3/rE5Iz+Q5GaThjmNw+SyEhK4E6UuQQMNdbH2G+N63TmF8xLVtEnAVl5nI/wESQQXC+ YEm8IIgcRP2CtZ0HTV8nFOzDD0pPK1X8eGC4sIta2zK+SjvYyQOORNwF/bKa2bZp2Gap0/ xlXOKZTEEnwZpkjMyR/MxtpJD4stITo= X-MC-Unique: rfGT0wC3OBq1jG5eqvF4dQ-1 X-Mimecast-MFC-AGG-ID: rfGT0wC3OBq1jG5eqvF4dQ_1744122668 To: devel@lists.libvirt.org Subject: [PATCH] esx: Accept empty "path" URI component same way as "/" Date: Tue, 8 Apr 2025 16:31:05 +0200 Message-ID: <2935e574b54d25f22325187dbfd3773ad068e6f0.1744122665.git.pkrempa@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: _rN15PFs1I9bFUsHPKXMMETB5okZTbDfl0bocsE4idw_1744122668 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JPGR6T2RFXDOK4CDUZWHQET233QJPAEI X-Message-ID-Hash: JPGR6T2RFXDOK4CDUZWHQET233QJPAEI X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Peter Krempa X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744122715902019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When connecting to "esx://" URI there's code which prints a warning that the path is not "empty". The check validates that "uri->path" is "/". In case when the user uses URI such as: esx://hostname the warning is printed as well. Since there is no effective difference betweeen the two allow empty strings as well. Resolves: https://issues.redhat.com/browse/RHEL-86459 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/esx/esx_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 6ae4ef9658..512ca6c028 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -687,7 +687,9 @@ esxConnectToVCenter(esxPrivate *priv, g_autofree char *url =3D NULL; if (!hostSystemIPAddress && - (!priv->parsedUri->path || STREQ(priv->parsedUri->path, "/"))) { + (!priv->parsedUri->path || + STREQ(priv->parsedUri->path, "") || + STREQ(priv->parsedUri->path, "/"))) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Path has to specify the datacenter and compute r= esource")); return -1; @@ -799,6 +801,7 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr au= th, virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); if (STRCASENEQ(conn->uri->scheme, "vpx") && + STRNEQ(conn->uri->path, "") && STRNEQ(conn->uri->path, "/")) { VIR_WARN("Ignoring unexpected path '%s' for non-vpx scheme '%s'", conn->uri->path, conn->uri->scheme); --=20 2.49.0