From nobody Sun Feb 8 21:11:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697443689; cv=none; d=zohomail.com; s=zohoarc; b=fmLFoD1sJqMaq8XqrCmMoiTVNHWgdnNmAf+8G/h/Q+Xy9zUfGxL+tMB+oQS9d8odzOaHfidcDPx94umWSQk3HlUF+GNsE0f54zgO2tZjajV4d3DVmMOk3sXVLa9ArUwcpW0hrXaI7rT2qMzEqE5hnWt5J7uUZ1TSJ5+0xsneRcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697443689; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=V5D4wDoaKqKCvbLZ+QlxViiqiXnE7uNtvA10zn+3PFA=; b=bRq8vvFTz8s1DHkohOM/rdun++MuqHjOEj/p+JAiImAXrT3etZe7S9r+kUTCKPkcphilGpBzt9+A049Ebv0rEMPi197dfVd7KWa7SustLoFCunn/sjTIyf0o7rVCuY3IESYCKFVNGknPCVWmpFuoppunOIRVoEFq9VtxQ+3mR04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697443689147148.28292792519903; Mon, 16 Oct 2023 01:08:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-519-uqHuy4CmNhSRqREmAW56JA-1; Mon, 16 Oct 2023 04:08:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97E9F946DE8; Mon, 16 Oct 2023 08:07:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82ADD1C060B1; Mon, 16 Oct 2023 08:07:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B654E19465B2; Mon, 16 Oct 2023 08:07:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DAD271946587 for ; Mon, 16 Oct 2023 08:07:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CF3EA40C6F7F; Mon, 16 Oct 2023 08:07:53 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7713C40C6F79 for ; Mon, 16 Oct 2023 08:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697443688; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=V5D4wDoaKqKCvbLZ+QlxViiqiXnE7uNtvA10zn+3PFA=; b=J+4DsnxsbgpSV0Ci1BlwtUmUjusRg3B4U9pfXvvbYFez+Diw3bHBSMiZzw6qPAKFl9/jpd fmRuKKdNJD2js44PERQt/G6jeEg2kM1DJpO9g5CfAvN38+dETmDgjzpGJgyOX99ZyCp1eg QOxMiRkm1zB2OPKsMbTxgjW1DG+7ino= X-MC-Unique: uqHuy4CmNhSRqREmAW56JA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] lib: Replace virBuildPath() with g_build_filename() Date: Mon, 16 Oct 2023 10:07:48 +0200 Message-ID: <09f7c60acf633a9364d16f83bbfa3156c2ba0a28.1697443656.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697443691038100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Our virBuildPath() constructs a path from given arguments. Exactly like g_build_filename(), except the latter is more generic as it uses backslashes on Windows. Therefore, replace the former with the latter. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/kbase/internals/command.rst | 2 +- src/util/virfcp.c | 2 +- src/util/virhook.c | 4 ++-- src/util/virpci.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/kbase/internals/command.rst b/docs/kbase/internals/comman= d.rst index 738fb5930a..d958c9d16a 100644 --- a/docs/kbase/internals/command.rst +++ b/docs/kbase/internals/command.rst @@ -444,7 +444,7 @@ src/util/hooks.c g_autofree char *path =3D NULL; g_autoptr(virCommand) cmd =3D NULL; =20 - virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr); + path =3D g_build_filename(LIBVIRT_HOOK_DIR, drvstr); =20 cmd =3D virCommandNew(path); =20 diff --git a/src/util/virfcp.c b/src/util/virfcp.c index bb62fa9025..052a6c99e1 100644 --- a/src/util/virfcp.c +++ b/src/util/virfcp.c @@ -38,7 +38,7 @@ virFCIsCapableRport(const char *rport) { g_autofree char *path =3D NULL; =20 - virBuildPath(&path, SYSFS_FC_RPORT_PATH, rport); + path =3D g_build_filename(SYSFS_FC_RPORT_PATH, rport, NULL); =20 return virFileExists(path); } diff --git a/src/util/virhook.c b/src/util/virhook.c index 50e178723f..d012bb1825 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -153,7 +153,7 @@ virHookCheck(int no, const char *driver) return -1; } =20 - virBuildPath(&path, LIBVIRT_HOOK_DIR, driver); + path =3D g_build_filename(LIBVIRT_HOOK_DIR, driver, NULL); =20 if (!virFileExists(path)) { VIR_DEBUG("No hook script %s", path); @@ -398,7 +398,7 @@ virHookCall(int driver, if (extra =3D=3D NULL) extra =3D "-"; =20 - virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr); + path =3D g_build_filename(LIBVIRT_HOOK_DIR, drvstr, NULL); =20 script_ret =3D 1; =20 diff --git a/src/util/virpci.c b/src/util/virpci.c index 08b82708b1..baacde4c14 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2396,7 +2396,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path, =20 *pf =3D NULL; =20 - virBuildPath(&device_link, vf_sysfs_path, "physfn"); + device_link =3D g_build_filename(vf_sysfs_path, "physfn", NULL); =20 if ((*pf =3D virPCIGetDeviceAddressFromSysfsLink(device_link))) { VIR_DEBUG("PF for VF device '%s': " VIR_PCI_DEVICE_ADDRESS_FMT, @@ -2580,7 +2580,7 @@ virPCIGetNetName(const char *device_link_sysfs_path, return -1; } =20 - virBuildPath(&pcidev_sysfs_net_path, device_link_sysfs_path, "net"); + pcidev_sysfs_net_path =3D g_build_filename(device_link_sysfs_path, "ne= t", NULL); =20 if (virDirOpenQuiet(&dir, pcidev_sysfs_net_path) < 0) { /* this *isn't* an error - caller needs to check for netname =3D= =3D NULL */ --=20 2.41.0