From nobody Mon Feb 9 18:18:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644275016378424.32156373241935; Mon, 7 Feb 2022 15:03:36 -0800 (PST) Received: from localhost ([::1]:46392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHD2l-0007dk-7m for importer@patchew.org; Mon, 07 Feb 2022 18:03:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHCge-0003yl-Pd for qemu-devel@nongnu.org; Mon, 07 Feb 2022 17:40:45 -0500 Received: from [2607:f8b0:4864:20::f2a] (port=37599 helo=mail-qv1-xf2a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHCgc-0005jF-Io for qemu-devel@nongnu.org; Mon, 07 Feb 2022 17:40:44 -0500 Received: by mail-qv1-xf2a.google.com with SMTP id a19so5870014qvm.4 for ; Mon, 07 Feb 2022 14:40:41 -0800 (PST) Received: from localhost.localdomain (209-6-248-219.s2265.c3-0.wrx-ubr1.sbo-wrx.ma.cable.rcncustomer.com. [209.6.248.219]) by smtp.gmail.com with ESMTPSA id j14sm6444744qko.10.2022.02.07.14.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 14:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iOIcalIHNF6yrPcbf+Gmut/tCJVPNjTdstiQ1nFEF/w=; b=QCtsq6iMJefdaC1CXvz5wKd2psBfrJial3xn6pIXbMdCESavJfAXMDsz2t0+8NRP86 diFO0SKEk1NrqGEtbzfJ9vJkNYmKhRMpQXwl8/ggp+7O4VK/x+WFn5GiqOpczVaxVSDA fPAQVl4XBJlGKnkUu3kLEELV1C1T+JyoMXrV0qTzttNzhAWRNkGb++wPaIXu/l16SbVw WYEaskdOdYqD8gl1oDIWvvmYc1cBEZDWnyE4D45en3xEsLDfWhHFcokpPSydHNoHjPsx kIloBq50n/AlBWE7ZyPIlt4kEjnqKIbAxdEz/SLzBOxqpiD3pn6VNapsS4aeWWaiokjn ZD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iOIcalIHNF6yrPcbf+Gmut/tCJVPNjTdstiQ1nFEF/w=; b=K2JvUhzoXs5U/2zMXEJxKv73bAOZIBC1I9bpahOJ3iCpm+igAwlw0sBUgqPqinKYlq 57aeVfyqzQMMrAIQfl8AtL0fHXY5iCj3U5+CJLkLkk0tP3mrdOfYdxZLCznvLGN3GOFX Bj2/apKwAIP6kCzGiTpZ9M5ASuhOKseWwL4rTfuRF6/ieVBs1Ec5yWpAn/9m+8l+SWst GW+c37m1FEF0vVRN2Ie4YbCjrA970vVPlLtisrQbk3SsbeqCxVzhIIJHSa8ecdkSks8l GGjaivuuEtg03g6IpmdeKn+0HuChgsOc/o7hQF968O8/UCPMS+rcfjTeBUKAKIDHVMer YZEA== X-Gm-Message-State: AOAM5302kTaVp9NVfgGnIDAbnWlT/voC4gkx7eF7nJsNtil7hTqYhCf5 L8zxWt7Nh9AwHvFPO+YstPBa9hrTw6S4ZQ== X-Google-Smtp-Source: ABdhPJxZWM8UAVJrqB5G+EAAu7EfGjQa+dPj9urGu19uJMI1nsqgeg6fg4floc91WdcLGLenthj1gg== X-Received: by 2002:a05:6214:1d05:: with SMTP id e5mr1172785qvd.28.1644273640289; Mon, 07 Feb 2022 14:40:40 -0800 (PST) From: Will Cohen To: qemu-devel@nongnu.org Subject: [PATCH v5 10/11] 9p: darwin: meson: Allow VirtFS on Darwin Date: Mon, 7 Feb 2022 17:40:23 -0500 Message-Id: <20220207224024.87745-11-wwcohen@gmail.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220207224024.87745-1-wwcohen@gmail.com> References: <20220207224024.87745-1-wwcohen@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2a (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=wwcohen@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Christian Schoenebeck , Greg Kurz , hi@alyssa.is, Michael Roitzsch , Will Cohen , Paolo Bonzini , Keno Fischer Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1644275017330100001 Content-Type: text/plain; charset="utf-8" From: Keno Fischer To allow VirtFS on darwin, we need to check that pthread_fchdir_np is available, which has only been available since macOS 10.12. Additionally, virtfs_proxy_helper is disabled on Darwin. This patch series does not currently provide an implementation of the proxy-helper, but this functionality could be implemented later on. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch [Will Cohen: - Rebase to master] Signed-off-by: Will Cohen Reviewed-by: Paolo Bonzini [Will Cohen: - Add check for pthread_fchdir_np to virtfs - Add comments to patch commit - Note that virtfs_proxy_helper does not work on macOS - Adjust meson virtfs error note to specify macOS] Signed-off-by: Will Cohen --- fsdev/meson.build | 1 + meson.build | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fsdev/meson.build b/fsdev/meson.build index adf57cc43e..b632b66348 100644 --- a/fsdev/meson.build +++ b/fsdev/meson.build @@ -7,6 +7,7 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files( 'qemu-fsdev.c', ), if_false: files('qemu-fsdev-dummy.c')) softmmu_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss) +softmmu_ss.add_all(when: 'CONFIG_DARWIN', if_true: fsdev_ss) =20 if have_virtfs_proxy_helper executable('virtfs-proxy-helper', diff --git a/meson.build b/meson.build index 5f43355071..c1d13209ff 100644 --- a/meson.build +++ b/meson.build @@ -1421,17 +1421,23 @@ if not get_option('dbus_display').disabled() endif endif =20 -have_virtfs =3D (targetos =3D=3D 'linux' and +if targetos =3D=3D 'darwin' and cc.has_function('pthread_fchdir_np') + have_virtfs =3D have_system +else + have_virtfs =3D (targetos =3D=3D 'linux' and have_system and libattr.found() and libcap_ng.found()) +endif =20 -have_virtfs_proxy_helper =3D have_virtfs and have_tools +have_virtfs_proxy_helper =3D targetos !=3D 'darwin' and have_virtfs and ha= ve_tools =20 if get_option('virtfs').enabled() if not have_virtfs - if targetos !=3D 'linux' - error('virtio-9p (virtfs) requires Linux') + if targetos !=3D 'linux' and targetos !=3D 'darwin' + error('virtio-9p (virtfs) requires Linux or macOS') + elif targetos =3D=3D 'darwin' and not cc.has_function('pthread_fchdir_= np') + error('virtio-9p (virtfs) on Darwin requires the presence of pthread= _fchdir_np') elif not libcap_ng.found() or not libattr.found() error('virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel= ') elif not have_system --=20 2.32.0 (Apple Git-132)