From patchwork Mon Feb 7 22:40:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Cohen X-Patchwork-Id: 12737942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5A85C433EF for ; Mon, 7 Feb 2022 23:03:26 +0000 (UTC) Received: from localhost ([::1]:46392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHD2b-0007dk-Pk for qemu-devel@archiver.kernel.org; Mon, 07 Feb 2022 18:03:25 -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) 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) 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) 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 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2a (failed) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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) 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 -have_virtfs = (targetos == 'linux' and +if targetos == 'darwin' and cc.has_function('pthread_fchdir_np') + have_virtfs = have_system +else + have_virtfs = (targetos == 'linux' and have_system and libattr.found() and libcap_ng.found()) +endif -have_virtfs_proxy_helper = have_virtfs and have_tools +have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools if get_option('virtfs').enabled() if not have_virtfs - if targetos != 'linux' - error('virtio-9p (virtfs) requires Linux') + if targetos != 'linux' and targetos != 'darwin' + error('virtio-9p (virtfs) requires Linux or macOS') + elif targetos == '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