From nobody Mon Feb 9 12:29:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1646402012; cv=none; d=zohomail.com; s=zohoarc; b=iCSWsQ6YgDjC/Gy6qelesCs+gqhnur5FQwmZ7P1bST+pvg9CpifnwIcE+BWh+UZILxkJ5Bw//MrmfXaMvVBFobaGIeX/3671EgqkpzKDNwWShFvHSvgQwEoYWkn1xSsaoXQnAiN6qqIKnJB95VGFnFIsE/cwkNg8yhBt1jVWDDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646402012; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=w23H3Dx87Ym5W3lYIQkXR14VvSyrEGHNHHYkXrQq2Io=; b=K8/hyVGK7L/zalAUCLHNHYLbpYOBRJrIHMA3I7L4efACN5JvcUDRwBPlUdDwXniSMyOpSI9hcXFfd33p1e9enjB5yayOT0wfx99T7m8FbFIqoR6kVxMK7Vg+gJcMLbJoKHV4qtENskyniQKOY6rXhxeAfYSkzs/8bumhmQLntwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1646402012757178.92624578193772; Fri, 4 Mar 2022 05:53:32 -0800 (PST) Received: from localhost ([::1]:56490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8N9-0005Yj-NW for importer@patchew.org; Fri, 04 Mar 2022 08:53:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <8744e9fc25ac8cc29c97ba3ee48050add2ba6b57@lizzy.crudebyte.com>) id 1nQ7wP-0001oz-1L for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:25:53 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:58635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <8744e9fc25ac8cc29c97ba3ee48050add2ba6b57@lizzy.crudebyte.com>) id 1nQ7wM-0006VF-Kb for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:25:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=w23H3Dx87Ym5W3lYIQkXR14VvSyrEGHNHHYkXrQq2Io=; b=iHqPb JaZu7IcW+5YRiGJm10mqTgaKSldyCF1cNKReq5tKydRqKzvgmUmaVgdajC04J/8cCf+os4FhuXoDI mAL6fVaPO3bAqBfK1Ayy8q6aPcLTPLcDrHfSdp2IBGz/qoUC+3WLg9TojlFn/Csmd76LBCWVYolpK N+eWtRqeUxNM4YkDoaSjzUYvMYq/FsTqBE4H+IsxXmHRB1/nkulIBpRQMRoraLO5gSP3MKseqbpbs tR8UXe/tRLK7c3FUWeJ/nLoBam5COQQ+KKZAXqD0yIgtPFYefXgCZylZn7FsW8NRG7vZg8htGVFsb ZXn4Q3mTsb72iou6oailuUgXZ+L7A==; Message-Id: <8744e9fc25ac8cc29c97ba3ee48050add2ba6b57.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT} To: qemu-devel@nongnu.org, Peter Maydell Cc: Greg Kurz 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: none client-ip=91.194.90.13; envelope-from=8744e9fc25ac8cc29c97ba3ee48050add2ba6b57@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1646402014335100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer Darwin doesn't have either of these flags. Darwin does have F_NOCACHE, which is similar to O_DIRECT, but has different enough semantics that other projects don't generally map them automatically. In any case, we don't support O_DIRECT on Linux at the moment either. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch [Will Cohen: - Adjust coding style] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-6-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p-util.h | 2 ++ hw/9pfs/9p.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 7449733c15..2b9ac74291 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -41,6 +41,7 @@ again: fd =3D openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK, mode); if (fd =3D=3D -1) { +#ifndef CONFIG_DARWIN if (errno =3D=3D EPERM && (flags & O_NOATIME)) { /* * The client passed O_NOATIME but we lack permissions to hono= r it. @@ -53,6 +54,7 @@ again: flags &=3D ~O_NOATIME; goto again; } +#endif return -1; } =20 diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index caf3b240fe..14e84c3bcf 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -138,11 +138,20 @@ static int dotl_to_open_flags(int flags) { P9_DOTL_NONBLOCK, O_NONBLOCK } , { P9_DOTL_DSYNC, O_DSYNC }, { P9_DOTL_FASYNC, FASYNC }, +#ifndef CONFIG_DARWIN + { P9_DOTL_NOATIME, O_NOATIME }, + /* + * On Darwin, we could map to F_NOCACHE, which is + * similar, but doesn't quite have the same + * semantics. However, we don't support O_DIRECT + * even on linux at the moment, so we just ignore + * it here. + */ { P9_DOTL_DIRECT, O_DIRECT }, +#endif { P9_DOTL_LARGEFILE, O_LARGEFILE }, { P9_DOTL_DIRECTORY, O_DIRECTORY }, { P9_DOTL_NOFOLLOW, O_NOFOLLOW }, - { P9_DOTL_NOATIME, O_NOATIME }, { P9_DOTL_SYNC, O_SYNC }, }; =20 @@ -171,10 +180,12 @@ static int get_dotl_openflags(V9fsState *s, int oflag= s) */ flags =3D dotl_to_open_flags(oflags); flags &=3D ~(O_NOCTTY | O_ASYNC | O_CREAT); +#ifndef CONFIG_DARWIN /* * Ignore direct disk access hint until the server supports it. */ flags &=3D ~O_DIRECT; +#endif return flags; } =20 --=20 2.20.1