From nobody Sat Feb 7 04:13:31 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 172675100532365.44417691103706; Thu, 19 Sep 2024 06:03:25 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 40BA71662; Thu, 19 Sep 2024 09:03:24 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C9C961636; Thu, 19 Sep 2024 09:02:29 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D6F6C1374; Thu, 19 Sep 2024 09:02:22 -0400 (EDT) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lists.libvirt.org (Postfix) with ESMTP id 0D6991396 for ; Thu, 19 Sep 2024 09:02:21 -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 28DE820C0A32; Thu, 19 Sep 2024 06:02:19 -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,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 28DE820C0A32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1726750939; bh=fwSWRBFwtaBJOg+EK1J9Z7w3WjLJ80jBf0ZLji+tW54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bt9Qk3rt02kCNKC+CSg/S8f/qNXMXQYBl9KMcY/qBwM9qoFSPVGfl475TcflwJvAk 3tJBcs2bBoq/elvh3CAvYF8HwZwR9plEKgJsF4N7p/st4tooc/3sXdJsTmSW2syO1b IfCEeVemteTeH7vowr2XtpVlGfixtQWkRrDFt6yk= From: Purna Pavan Chandra Aekkaladevi To: devel@lists.libvirt.org Subject: [PATCH 1/6] utils: Implement virFileIsNamedPipe Date: Thu, 19 Sep 2024 13:02:13 +0000 Message-Id: <20240919130218.738434-2-paekkaladevi@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919130218.738434-1-paekkaladevi@linux.microsoft.com> References: <20240919130218.738434-1-paekkaladevi@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HB4FX6SA442QP5XOWPVXRQZEFOWGIQQ4 X-Message-ID-Hash: HB4FX6SA442QP5XOWPVXRQZEFOWGIQQ4 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, prapal@linux.microsoft.com, liuwe@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: 1726751007132116600 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 f15d16c292..4dac9c17f6 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