From nobody Sun Feb 8 18:32:47 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=1693322009; cv=none; d=zohomail.com; s=zohoarc; b=mOeV/B8CI8pnA6cSLkNLJjLmjT3CTRJaPrXEgSHqo85JyYFT5+bZqzRYEt3C+0SbX25IXcngelEzoWq4IGURcSzXs+VWfJ3mhEMXbT8DzzrkbqKTPUPnmqM2xl7HnZf0H1FytNxBlcBQEWqBH3+Rhvw0HvONqLNa7rJCV3a2/9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693322009; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e800CE9YRmY5o3EskC2n2Wb9JYDeK+jU7slDX0lEfDA=; b=oAaugJp0a0cRcu/7NAHvT1V/uhPjErplGDwf2E2TXVhnwKx1tSQPOPD8DZmKJ5jXvF2Q2cLy1v/KKxaFra9fIb15AB3HqyvYd2ShECGS7VKSAu5vbdCGKGbk2XQcmAm3kV7VECGkgW6SGzfOjpKIedzpYR7Qk9/O9dCmTtE+MsA= 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 1693322009591195.9923431588553; Tue, 29 Aug 2023 08:13:29 -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-611-LvnXiU7iPx-e9XS4CCs4GQ-1; Tue, 29 Aug 2023 11:13:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CFC52802C1E; Tue, 29 Aug 2023 15:13:21 +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 BDEB22166B27; Tue, 29 Aug 2023 15:13:21 +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 9A3BA19451C7; Tue, 29 Aug 2023 15:13:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EF55119465B6 for ; Tue, 29 Aug 2023 15:13:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DAB1D40C2063; Tue, 29 Aug 2023 15:13:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 820CB40C2070 for ; Tue, 29 Aug 2023 15:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693322008; 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=e800CE9YRmY5o3EskC2n2Wb9JYDeK+jU7slDX0lEfDA=; b=hM/Oe9u99PVOAEqGxC/vnkgfYnhDX9egFpp5EdFQ8UAhJ3rj7/wXkjfIFC3OMEmEduTMgG ZzwihA+je3SyieuC+3Ss3XdWXmSb5v2weTUrr69MGKasVyY/OB9Iu/FDuunMl/2SV58vKj oOm6sYcGewV9M78UvwDwENTkI4LKI2g= X-MC-Unique: LvnXiU7iPx-e9XS4CCs4GQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs Date: Tue, 29 Aug 2023 17:13:09 +0200 Message-ID: <720db08aa2243b6a5012cd424130c620b4529ae3.1693321948.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.1 on 10.11.54.6 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: 1693322010497100003 Content-Type: text/plain; charset="utf-8"; x-default="true" On BSD-like systems "/dev/fd" serves the same purpose as "/proc/self/fd". And since procfs is usually not mounted, on such systems we can use "/dev/fd" instead. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/518 Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 8c06e19723..2b3b125e5f 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -518,6 +518,8 @@ virCommandMassCloseGetFDs(virBitmap *fds) * onto child process (well, the one we will exec soon since this * is called from the child). */ return virCommandMassCloseGetFDsDir(fds, "/proc/self/fd"); +# elif defined(__APPLE__) || defined(__FreeBSD__) + return virCommandMassCloseGetFDsDir(fds, "/dev/fd"); # else virBitmapSetAll(fds); return 0; --=20 2.41.0