From nobody Sat Feb 7 05:52:03 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=fail(p=none dis=none) header.from=linux.microsoft.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1727785306426486.868056654004; Tue, 1 Oct 2024 05:21:46 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5A67C15D4; Tue, 1 Oct 2024 08:21:45 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7D2C015A7; Tue, 1 Oct 2024 08:20:57 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8D83C123B; Tue, 1 Oct 2024 08:20:53 -0400 (EDT) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lists.libvirt.org (Postfix) with ESMTP id 130031221 for ; Tue, 1 Oct 2024 08:20:53 -0400 (EDT) Received: from paekkaladevi-dev-u22.gi4irqh5pfqublruu4yyku2wof.phxx.internal.cloudapp.net (unknown [20.125.125.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 401BC20CECC3; Tue, 1 Oct 2024 05:20:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 401BC20CECC3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1727785251; bh=QJPj3Wsrnv2IeT5+fHl2LLCVkM7JijbuSUi9u9nhTSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IUafE1tuv80zMJyRmFzoZfuPZxfTVn3y4lzchEZJsoOU24I/4JmbxOsn+kn665XR/ 0alPXGPt3E0R3mWbsKurkQ8suK4Gvw3VNj7xXMIr16SW3RU5PWnsM/1oYCIAPLDIdj liCADq0XyS607KLf0BkMZVY7AYZYS55R6BVLODEg= From: Purna Pavan Chandra Aekkaladevi To: devel@lists.libvirt.org Subject: [PATCH v2 1/6] utils: Implement virFileIsNamedPipe Date: Tue, 1 Oct 2024 12:20:45 +0000 Message-Id: <20241001122050.20099-2-paekkaladevi@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241001122050.20099-1-paekkaladevi@linux.microsoft.com> References: <20241001122050.20099-1-paekkaladevi@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: J6BAC3YN6WJOMXMUFB4OLJLCTU2HMOWE X-Message-ID-Hash: J6BAC3YN6WJOMXMUFB4OLJLCTU2HMOWE X-MailFrom: paekkaladevi@linux.microsoft.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: paekkaladevi@microsoft.com, prasad.krishnan@microsoft.com, liuwe@microsoft.com, prapal@linux.microsoft.com, Purna Pavan Chandra Aekkaladevi 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: X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1727785306931116600 Content-Type: text/plain; charset="utf-8" virFileIsNamedPipe checks whether passed path is a FIFO file or not. Signed-off-by: Purna Pavan Chandra Aekkaladevi Co-authored-by: Vineeth Pillai --- src/libvirt_private.syms | 1 + src/util/virfile.c | 8 ++++++++ src/util/virfile.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 02dacea857..6bf6cfd20b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2357,6 +2357,7 @@ virFileIsDir; virFileIsExecutable; virFileIsLink; virFileIsMountPoint; +virFileIsNamedPipe; virFileIsRegular; virFileIsSharedFS; virFileIsSharedFSType; diff --git a/src/util/virfile.c b/src/util/virfile.c index d820172405..19b074ed8a 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2023,6 +2023,14 @@ virFileIsDir(const char *path) } =20 =20 +bool +virFileIsNamedPipe(const char *path) +{ + struct stat s; + return (stat(path, &s) =3D=3D 0) && S_ISFIFO(s.st_mode); +} + + bool virFileIsRegular(const char *path) { diff --git a/src/util/virfile.h b/src/util/virfile.h index 7df3fcb840..4f7ff72483 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -215,6 +215,7 @@ void virFileActivateDirOverrideForLib(void); =20 off_t virFileLength(const char *path, int fd) ATTRIBUTE_NONNULL(1); bool virFileIsDir (const char *file) ATTRIBUTE_NONNULL(1); +bool virFileIsNamedPipe (const char *file) ATTRIBUTE_NONNULL(1); bool virFileExists(const char *file) ATTRIBUTE_NONNULL(1) G_NO_INLINE; bool virFileIsExecutable(const char *file) ATTRIBUTE_NONNULL(1); bool virFileIsRegular(const char *file) ATTRIBUTE_NONNULL(1); --=20 2.34.1