From nobody Tue May 14 07:25:53 2024 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=1646400138; cv=none; d=zohomail.com; s=zohoarc; b=V+jPL1UGcxMOdWBS+v2Hbm7e7VPPiebOxF8WFqjSUdbeBjKmFUsYU/6GCyvIuolZepK5Sb9hn4+19xEz/8XiFOWnlJSQww8P/qdfw9VG2/zjfY8hqYEYT4GqkvIZUGaUlVEFCwnneWq/+nKJ8SVM296uxOIBUo8FqCQuz0KZqj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400138; h=Content-Type:Content-Transfer-Encoding:Cc: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=KO3uCcDtoP8ypvHqVZeogjqwQxCYF7uWlWLOucj+apQ=; b=YiedNxG9ylOud5qbUeKkeZOs5pi8Tg/o/xvOLfwShBnAGO/pHKwTkHv9PnQBwZ/gcjW1ugA8chAQz9JhQeefPiix3fn4zotkYe3hMYcqom5PJ/IfBUQzeep/qvh5wxkGbiMzjP0mrwBbFOv1zu+LqWNQndy16qMTzQ/hnEAbVm0= 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 164640013809244.620359973119434; Fri, 4 Mar 2022 05:22:18 -0800 (PST) Received: from localhost ([::1]:54866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7su-0005Uq-OU for importer@patchew.org; Fri, 04 Mar 2022 08:22:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <9bca156323feb554c2eb54aa3888a4445666437b@lizzy.crudebyte.com>) id 1nQ7lt-0000lP-5P for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:15:02 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:49909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <9bca156323feb554c2eb54aa3888a4445666437b@lizzy.crudebyte.com>) id 1nQ7lr-000667-FH for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:15:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Date:From:References:In-Reply-To:Message-Id:Content-ID: Content-Description; bh=KO3uCcDtoP8ypvHqVZeogjqwQxCYF7uWlWLOucj+apQ=; b=PQG1q E4KgRSngS09ShDII/fCbrzpF6fTn/eAcusTM/YRBvgaihmEgJxHTuCxbkaw2R06hnZV6MvlUX6K0y vNSnl4h5mshCLoaWr/fbtNgtxnjBCG0iJ2U4pUY8bZFbm6OE4PoWfm54wp2N9YWQa0FIrIlLiDTvF 8+tSOvvGwNyvZfHfxvXVDQrimkzvMSo8Yyy7KwfTttEBUi2D3YFuv9pt63PdEBkzl2gTP/sGjrMRT Hlf4DVT0WXjE8mnQzTBn31gbZgsV3L2cC9Q6DZDXqdiwNTv9rUh9BDw/mugogNKWlrfBNipgsI1uj enOqpJdAxtnL4zMmdUVBwaBmGXj0w==; Message-Id: <9bca156323feb554c2eb54aa3888a4445666437b.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 01/19] 9p: linux: Fix a couple Linux assumptions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=9bca156323feb554c2eb54aa3888a4445666437b@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: 1646400138744100001 From: Keno Fischer - Guard Linux only headers. - Add qemu/statfs.h header to abstract over the which headers are needed for struct statfs - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch While it might at first appear that fsdev/virtfs-proxy-header.c would need similar adjustment for darwin as file-op-9p here, a later patch in this series disables virtfs-proxy-helper for non-Linux. Allowing virtfs-proxy-helper on darwin could potentially be an additional optimization later. [Will Cohen: - Fix headers for Alpine - Integrate statfs.h back into file-op-9p.h - Remove superfluous header guards from file-opt-9p - Add note about virtfs-proxy-helper being disabled on non-Linux for this patch series] Signed-off-by: Will Cohen Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Greg Kurz Message-Id: <20220227223522.91937-2-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck --- fsdev/file-op-9p.h | 9 ++++++++- hw/9pfs/9p-local.c | 2 ++ hw/9pfs/9p.c | 4 ++++ include/qemu/xattr.h | 4 +++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 8fd89f0447..4997677460 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -16,10 +16,17 @@ =20 #include #include -#include #include "qemu-fsdev-throttle.h" #include "p9array.h" =20 +#ifdef CONFIG_LINUX +# include +#endif +#ifdef CONFIG_DARWIN +# include +# include +#endif + #define SM_LOCAL_MODE_BITS 0600 #define SM_LOCAL_DIR_MODE_BITS 0700 =20 diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 210d9e7705..1a5e3eed73 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -32,10 +32,12 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include +#ifdef CONFIG_LINUX #include #ifdef CONFIG_LINUX_MAGIC_H #include #endif +#endif #include =20 #ifndef XFS_SUPER_MAGIC diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 15b3f4d385..9c63e14b28 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -32,7 +32,11 @@ #include "migration/blocker.h" #include "qemu/xxhash.h" #include +#ifdef CONFIG_LINUX #include +#else +#include +#endif =20 int open_fd_hw; int total_open_fd; diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h index a83fe8e749..f1d0f7be74 100644 --- a/include/qemu/xattr.h +++ b/include/qemu/xattr.h @@ -22,7 +22,9 @@ #ifdef CONFIG_LIBATTR # include #else -# define ENOATTR ENODATA +# if !defined(ENOATTR) +# define ENOATTR ENODATA +# endif # include #endif =20 --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646401785; cv=none; d=zohomail.com; s=zohoarc; b=R5NR7fqu6d+jOc/5IzUbqLCIMFKfPpYHSdxu4OKArHMobiobX7KkxNusu0qXsYTk8TzBrrNqius9SCZhCkL1sZpWWFC3LbGAtP5fSiWqkxmbSrLGyDEbo0ylaRLbLtO4wyaZeuXj2I9C5wHifTkBtl3rGkHJni9BhasrDrJ3sH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646401785; h=Content-Type:Content-Transfer-Encoding:Cc: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=5oLuXWTJKZvpRWIxoiPJFUVce5lljtpqW3n1BbXrpOw=; b=H8FXlHfXWDWDne17lQB56K8exyoBEAR0+I1wRms2m4UKLhi7ymyJHOvr31NLDeMQ8Z3y/xPP7FTiaK0ojgWyaxslGPDbn5FBNEPmjzu8PiDUFOKQ3Ztxy6ohdA+0pwMmD+tZHsp5OHTUHYjaDswmms0QI1Hk+lR2zI0sx6Ocrss= 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 1646401785723991.6448950890161; Fri, 4 Mar 2022 05:49:45 -0800 (PST) Received: from localhost ([::1]:47856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8JU-0007lV-AD for importer@patchew.org; Fri, 04 Mar 2022 08:49:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <29241fc0ad2cf5c45ee005befc8d3bad04a79914@lizzy.crudebyte.com>) id 1nQ7tL-0007D4-AB for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:22:46 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:57025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <29241fc0ad2cf5c45ee005befc8d3bad04a79914@lizzy.crudebyte.com>) id 1nQ7tG-0001i7-Dn for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:22:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Content-Transfer-Encoding:Content-Type: MIME-Version:Subject:Date:From:References:In-Reply-To:Message-Id:Content-ID: Content-Description; bh=5oLuXWTJKZvpRWIxoiPJFUVce5lljtpqW3n1BbXrpOw=; b=LeD6B gBR43o7tsMRUbG8KWwvV/C+MXm88W9UpJgUz/cyuRNfwNmInBcog0CKjTchhLwzCqafFJe2M3GL6N Q4v7e7L9FhkH0BsVJEOEGUJIUd8+BYECqQfeQjkT9e01IhWBVCTB4AqutuYxVSGP2Ro1pTGLmj0CK bYz7vdnPjDH4oRi/PudWDbtvevwoVQyzLBbdKLm+a2TmqhOQv1ojd9evlHttVp9Xd/h8h9Au/BD0u P3yRislJN8J5z+RyChRQTpopThVHNvdnQBTZGF5VrOIn2XPVDqZg8ps07SVHo73YgrAgbCnJ0cDjT cTPFbefPhYbleSvO40uXJPQdAz6NQ==; Message-Id: <29241fc0ad2cf5c45ee005befc8d3bad04a79914.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 02/19] 9p: Rename 9p-util -> 9p-util-linux MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=29241fc0ad2cf5c45ee005befc8d3bad04a79914@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: 1646401787805100001 From: Keno Fischer The current file only has the Linux versions of these functions. Rename the file accordingly and update the Makefile to only build it on Linux. A Darwin version of these will follow later in the series. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch Signed-off-by: Will Cohen Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20220227223522.91937-3-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck --- hw/9pfs/{9p-util.c =3D> 9p-util-linux.c} | 2 +- hw/9pfs/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename hw/9pfs/{9p-util.c =3D> 9p-util-linux.c} (97%) diff --git a/hw/9pfs/9p-util.c b/hw/9pfs/9p-util-linux.c similarity index 97% rename from hw/9pfs/9p-util.c rename to hw/9pfs/9p-util-linux.c index 3221d9b498..398614a5d0 100644 --- a/hw/9pfs/9p-util.c +++ b/hw/9pfs/9p-util-linux.c @@ -1,5 +1,5 @@ /* - * 9p utilities + * 9p utilities (Linux Implementation) * * Copyright IBM, Corp. 2017 * diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build index 99be5d9119..1b28e70040 100644 --- a/hw/9pfs/meson.build +++ b/hw/9pfs/meson.build @@ -4,7 +4,6 @@ fs_ss.add(files( '9p-posix-acl.c', '9p-proxy.c', '9p-synth.c', - '9p-util.c', '9p-xattr-user.c', '9p-xattr.c', '9p.c', @@ -14,6 +13,7 @@ fs_ss.add(files( 'coth.c', 'coxattr.c', )) +fs_ss.add(when: 'CONFIG_LINUX', if_true: files('9p-util-linux.c')) fs_ss.add(when: 'CONFIG_XEN', if_true: files('xen-9p-backend.c')) softmmu_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss) =20 --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646402675; cv=none; d=zohomail.com; s=zohoarc; b=WRrwSyahRmT5IUcS6pDeVwujaPovJ1XskrVDy+VoqddPJlKll2fbNQUAx+JDdnbgPg1tnUCK0gSxxL5KkTzz4Hl6ceFu2cw+evI6oP0K4K+jX8K5Hse+bvAPGfUKXGzcsER6W+LxavLBkCRIepiicD2iM8Y0SbIrCJXQPJwIvVI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646402675; 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=Q5FQJ2Reo2gOK3Lkjz7qs1014MSz8wpQlPECzV97A/A=; b=YeNjVL2v++MUYcueekqy0GSaxwlVr/GT3idFvd0JKUsdU5sKFu7a/d/qj5SZL5Cwz0xlPNpE5C2HD096qB+K0lMOfHU73R4EtCY6kMK8rwWjFD26JIunlPXNNWzJFklaoqeN8d+yHPmrbytPCweBzuBFKNNamddrG/q39egSO7M= 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 1646402675598842.8124994384053; Fri, 4 Mar 2022 06:04:35 -0800 (PST) Received: from localhost ([::1]:54622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8Xp-0007hF-Uu for importer@patchew.org; Fri, 04 Mar 2022 09:04:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ80U-0005yo-5o for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:30:07 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:37391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ80Q-0007Gw-A3 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:30:05 -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=Q5FQJ2Reo2gOK3Lkjz7qs1014MSz8wpQlPECzV97A/A=; b=SBWVD OVNn8JZku/PRIAZg7ttx8oRblcwEG6Bj6ORFbdOw3SxIbuVfbtZZBQ3GR6PK+6Q+RRn/StJF6YjmP VzACYTDRls1vZhYGhT37k4E8bUUgI+Oty/GbiVNv3YFMx1E9vyiiSW1rZl1TIMhiGpFnl6GEm8tAC gk8vU9wdhIzrSoauV1ipIHUpzI5wZiVqipY0L5JgvWuwmChUAf7stKNLezuexbqYIg1CfZV0uf0La FsCoMuBFfQwC5HSu+u88oIp1K+L0Cl/gR/E99Kn0oZuKglyTqa1zB6tMge+g8etTH6mMWbrOlboqJ jD7rVx6t7CVTsJlrx4w2+Sn4Gb6eA==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 03/19] 9p: darwin: Handle struct stat(fs) differences 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=f0cd1d0069f92bfced8b0d8002da6093850c4ebc@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: 1646402676035100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer Signed-off-by: Keno Fischer Signed-off-by: Michael Roitzsch [Will Cohen: - Note lack of f_namelen and f_frsize on Darwin - Ensure that tv_sec and tv_nsec are both initialized for Darwin and non-Darwin] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-4-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p-proxy.c | 22 ++++++++++++++++++++-- hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c | 16 ++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 09bd9f1464..b1664080d8 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -123,10 +123,16 @@ static void prstatfs_to_statfs(struct statfs *stfs, P= roxyStatFS *prstfs) stfs->f_bavail =3D prstfs->f_bavail; stfs->f_files =3D prstfs->f_files; stfs->f_ffree =3D prstfs->f_ffree; +#ifdef CONFIG_DARWIN + /* f_namelen and f_frsize do not exist on Darwin */ + stfs->f_fsid.val[0] =3D prstfs->f_fsid[0] & 0xFFFFFFFFU; + stfs->f_fsid.val[1] =3D prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU; +#else stfs->f_fsid.__val[0] =3D prstfs->f_fsid[0] & 0xFFFFFFFFU; stfs->f_fsid.__val[1] =3D prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU; stfs->f_namelen =3D prstfs->f_namelen; stfs->f_frsize =3D prstfs->f_frsize; +#endif } =20 /* Converts proxy_stat structure to VFS stat structure */ @@ -143,12 +149,24 @@ static void prstat_to_stat(struct stat *stbuf, ProxyS= tat *prstat) stbuf->st_size =3D prstat->st_size; stbuf->st_blksize =3D prstat->st_blksize; stbuf->st_blocks =3D prstat->st_blocks; + stbuf->st_atime =3D prstat->st_atim_sec; + stbuf->st_mtime =3D prstat->st_mtim_sec; + stbuf->st_ctime =3D prstat->st_ctim_sec; +#ifdef CONFIG_DARWIN + stbuf->st_atimespec.tv_sec =3D prstat->st_atim_sec; + stbuf->st_mtimespec.tv_sec =3D prstat->st_mtim_sec; + stbuf->st_ctimespec.tv_sec =3D prstat->st_ctim_sec; + stbuf->st_atimespec.tv_nsec =3D prstat->st_atim_nsec; + stbuf->st_mtimespec.tv_nsec =3D prstat->st_mtim_nsec; + stbuf->st_ctimespec.tv_nsec =3D prstat->st_ctim_nsec; +#else stbuf->st_atim.tv_sec =3D prstat->st_atim_sec; + stbuf->st_mtim.tv_sec =3D prstat->st_mtim_sec; + stbuf->st_ctim.tv_sec =3D prstat->st_ctim_sec; stbuf->st_atim.tv_nsec =3D prstat->st_atim_nsec; - stbuf->st_mtime =3D prstat->st_mtim_sec; stbuf->st_mtim.tv_nsec =3D prstat->st_mtim_nsec; - stbuf->st_ctime =3D prstat->st_ctim_sec; stbuf->st_ctim.tv_nsec =3D prstat->st_ctim_nsec; +#endif } =20 /* diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 7a7cd5c5ba..bf9b0c5ddd 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -439,7 +439,9 @@ static int synth_statfs(FsContext *s, V9fsPath *fs_path, stbuf->f_bsize =3D 512; stbuf->f_blocks =3D 0; stbuf->f_files =3D synth_node_count; +#ifndef CONFIG_DARWIN stbuf->f_namelen =3D NAME_MAX; +#endif return 0; } =20 diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9c63e14b28..1563d7b7c6 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1313,11 +1313,17 @@ static int stat_to_v9stat_dotl(V9fsPDU *pdu, const = struct stat *stbuf, v9lstat->st_blksize =3D stat_to_iounit(pdu, stbuf); v9lstat->st_blocks =3D stbuf->st_blocks; v9lstat->st_atime_sec =3D stbuf->st_atime; - v9lstat->st_atime_nsec =3D stbuf->st_atim.tv_nsec; v9lstat->st_mtime_sec =3D stbuf->st_mtime; - v9lstat->st_mtime_nsec =3D stbuf->st_mtim.tv_nsec; v9lstat->st_ctime_sec =3D stbuf->st_ctime; +#ifdef CONFIG_DARWIN + v9lstat->st_atime_nsec =3D stbuf->st_atimespec.tv_nsec; + v9lstat->st_mtime_nsec =3D stbuf->st_mtimespec.tv_nsec; + v9lstat->st_ctime_nsec =3D stbuf->st_ctimespec.tv_nsec; +#else + v9lstat->st_atime_nsec =3D stbuf->st_atim.tv_nsec; + v9lstat->st_mtime_nsec =3D stbuf->st_mtim.tv_nsec; v9lstat->st_ctime_nsec =3D stbuf->st_ctim.tv_nsec; +#endif /* Currently we only support BASIC fields in stat */ v9lstat->st_result_mask =3D P9_STATS_BASIC; =20 @@ -3519,9 +3525,15 @@ static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *p= du, struct statfs *stbuf) f_bavail =3D stbuf->f_bavail / bsize_factor; f_files =3D stbuf->f_files; f_ffree =3D stbuf->f_ffree; +#ifdef CONFIG_DARWIN + fsid_val =3D (unsigned int)stbuf->f_fsid.val[0] | + (unsigned long long)stbuf->f_fsid.val[1] << 32; + f_namelen =3D NAME_MAX; +#else fsid_val =3D (unsigned int) stbuf->f_fsid.__val[0] | (unsigned long long)stbuf->f_fsid.__val[1] << 32; f_namelen =3D stbuf->f_namelen; +#endif =20 return pdu_marshal(pdu, offset, "ddqqqqqqd", f_type, f_bsize, f_blocks, f_bfree, --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646401326; cv=none; d=zohomail.com; s=zohoarc; b=ChDcYVetnObyvCMMay8UuairjwbrdaLYJN6ryJny7CV2AIK3yYdLnzoD8n1zNmX9xQrApVezGezeKtqoPV8z7g8DIinFUnlcW47kfM1cML0qncFxsiZg1xked8S/0/VdOMGX5Tc+UJjrlv1x6YZ2Ilh5mhaUn/JyxHRCQ0mgB/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646401326; 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=3u34sir+ZeZHfQZGfZ8IvSlB23QK/T53fLss006PEqs=; b=l/LHOMV7QhCs50Klb3ZDCH+8N76LM+3ysgqBe3mH2urEcPtUoN2NCmEWa1WqaxrXdyDNQRp7Zq4TDrajqcUdtDakDqDSsqfGPQD89U1/LRj6rNVlEt+Rhq3wZDQFl1LbFf4nRg8Lw2OhGtn3TaW3RATR0lZ/+aYuRYWAEJy+Vlw= 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 1646401326814187.78459442835208; Fri, 4 Mar 2022 05:42:06 -0800 (PST) Received: from localhost ([::1]:57666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8C6-00036o-Bu for importer@patchew.org; Fri, 04 Mar 2022 08:42:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7q3-00046I-Ag for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:19:22 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:50537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7pz-0006xU-Hk for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:19:16 -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=3u34sir+ZeZHfQZGfZ8IvSlB23QK/T53fLss006PEqs=; b=ph8Pm 2j92lahBMNwTjJ6VVGAJO0q2KWhXRN1BoRTy7TAYqGrPsmJ/aQqUvt106LaGC1qu3PQWKUl6EnGwT Ce1i2rUgfxfKqChKTT+jdsoVV86+aeIF5Q6vIhkrNGaLo+CzXC/qJ+pmYdadq4kxxB9TCMlW6kkR+ LOxyS4PSGIW/Swrwg1uZeU92Hl1YX3Sl+j5uIQfNUz5aKL29wWi4LQz4UsqfZGZhXrzxwYZrfPyQF hIwUVBsLTqdYKJjKYep8+fR+0LXOnU4NnRve4dz3Fsei+AtNyXkG3Lzbx2WTNsDE3jlXmd7aaqxPP mX6IXSQ5yK7iXNllD70mnr8b7igRg==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 04/19] 9p: darwin: Handle struct dirent differences 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=cff1ca391fd7c6af90edb8f237f15a756eaffafe@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: 1646401328313100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer On darwin d_seekoff exists, but is optional and does not seem to be commonly used by file systems. Use `telldir` instead to obtain the seek offset and inject it into d_seekoff, and create a qemu_dirent_off helper to call it appropriately when appropriate. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch [Will Cohen: - Adjust to pass testing - Ensure that d_seekoff is filled using telldir on darwin, and create qemu_dirent_off helper to decide which to access] [Fabian Franz: - Add telldir error handling for darwin] Signed-off-by: Fabian Franz [Will Cohen: - Ensure that telldir error handling uses signed int - Cleanup of telldir error handling - Remove superfluous error handling for qemu_dirent_off - Adjust formatting - Use qemu_dirent_off in codir.c - Declare qemu_dirent_off as static to prevent linker error - Move qemu_dirent_off above the end-of-file endif to fix compilation] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-5-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p-local.c | 9 +++++++++ hw/9pfs/9p-proxy.c | 16 +++++++++++++++- hw/9pfs/9p-synth.c | 4 ++++ hw/9pfs/9p-util.h | 16 ++++++++++++++++ hw/9pfs/9p.c | 7 +++++-- hw/9pfs/codir.c | 4 +++- 6 files changed, 52 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 1a5e3eed73..f3272f0b43 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -562,6 +562,15 @@ again: if (!entry) { return NULL; } +#ifdef CONFIG_DARWIN + int off; + off =3D telldir(fs->dir.stream); + /* If telldir fails, fail the entire readdir call */ + if (off < 0) { + return NULL; + } + entry->d_seekoff =3D off; +#endif =20 if (ctx->export_flags & V9FS_SM_MAPPED) { entry->d_type =3D DT_UNKNOWN; diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index b1664080d8..8b4b5cf7dc 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -706,7 +706,21 @@ static off_t proxy_telldir(FsContext *ctx, V9fsFidOpen= State *fs) =20 static struct dirent *proxy_readdir(FsContext *ctx, V9fsFidOpenState *fs) { - return readdir(fs->dir.stream); + struct dirent *entry; + entry =3D readdir(fs->dir.stream); +#ifdef CONFIG_DARWIN + if (!entry) { + return NULL; + } + int td; + td =3D telldir(fs->dir.stream); + /* If telldir fails, fail the entire readdir call */ + if (td < 0) { + return NULL; + } + entry->d_seekoff =3D td; +#endif + return entry; } =20 static void proxy_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off) diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index bf9b0c5ddd..b3080e415b 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -234,7 +234,11 @@ static void synth_direntry(V9fsSynthNode *node, offsetof(struct dirent, d_name) + sz); memcpy(entry->d_name, node->name, sz); entry->d_ino =3D node->attr->inode; +#ifdef CONFIG_DARWIN + entry->d_seekoff =3D off + 1; +#else entry->d_off =3D off + 1; +#endif } =20 static struct dirent *synth_get_dentry(V9fsSynthNode *dir, diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 546f46dc7d..7449733c15 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -78,4 +78,20 @@ ssize_t flistxattrat_nofollow(int dirfd, const char *fil= ename, ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, const char *name); =20 +/** + * Darwin has d_seekoff, which appears to function similarly to d_off. + * However, it does not appear to be supported on all file systems, + * so ensure it is manually injected earlier and call here when + * needed. + */ +static inline off_t qemu_dirent_off(struct dirent *dent) +{ +#ifdef CONFIG_DARWIN + return dent->d_seekoff; +#else + return dent->d_off; +#endif +} + + #endif diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 1563d7b7c6..caf3b240fe 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -27,6 +27,7 @@ #include "virtio-9p.h" #include "fsdev/qemu-fsdev.h" #include "9p-xattr.h" +#include "9p-util.h" #include "coth.h" #include "trace.h" #include "migration/blocker.h" @@ -2281,7 +2282,7 @@ static int coroutine_fn v9fs_do_readdir_with_stat(V9f= sPDU *pdu, count +=3D len; v9fs_stat_free(&v9stat); v9fs_path_free(&path); - saved_dir_pos =3D dent->d_off; + saved_dir_pos =3D qemu_dirent_off(dent); } =20 v9fs_readdir_unlock(&fidp->fs.dir); @@ -2420,6 +2421,7 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu,= V9fsFidState *fidp, V9fsString name; int len, err =3D 0; int32_t count =3D 0; + off_t off; struct dirent *dent; struct stat *st; struct V9fsDirEnt *entries =3D NULL; @@ -2480,12 +2482,13 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pd= u, V9fsFidState *fidp, qid.version =3D 0; } =20 + off =3D qemu_dirent_off(dent); v9fs_string_init(&name); v9fs_string_sprintf(&name, "%s", dent->d_name); =20 /* 11 =3D 7 + 4 (7 =3D start offset, 4 =3D space for storing count= ) */ len =3D pdu_marshal(pdu, 11 + count, "Qqbs", - &qid, dent->d_off, + &qid, off, dent->d_type, &name); =20 v9fs_string_free(&name); diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index c0873bde16..f96d8ac4e6 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -22,6 +22,8 @@ #include "qemu/coroutine.h" #include "qemu/main-loop.h" #include "coth.h" +#include "9p-xattr.h" +#include "9p-util.h" =20 /* * Intended to be called from bottom-half (e.g. background I/O thread) @@ -166,7 +168,7 @@ static int do_readdir_many(V9fsPDU *pdu, V9fsFidState *= fidp, } =20 size +=3D len; - saved_dir_pos =3D dent->d_off; + saved_dir_pos =3D qemu_dirent_off(dent); } =20 /* restore (last) saved position */ --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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 From nobody Tue May 14 07:25:53 2024 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=1646402462; cv=none; d=zohomail.com; s=zohoarc; b=eQxrtJFMYwtMc2l3qBgZ/fp6Tslu+ekzaBUsbF0+KjoJ2UZpcF43u2NiocM4zeES3OreKOu6xfCWb3Awdez7zlGhJ0u2rFqu7YFmCQMaXuh2GCOioiAXfp3y/AMHULhmXLSsD6UxpAbQNuSbcycSrdwzFMDILDaof3Q3rb0l6XI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646402462; 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=E9U8f+CE/a5/AN3TPLs6/9FG2x5Jkw+GdC7Z0ig5vNY=; b=gQP8DnDa2/+A1Dp7IIu5T99Qcn0U+t3XwQiRwJXSRu7wPGiumGhEnMQmUhyQlVNwlK5lRs3bSzzjg1PD8G46kCsvqe1ZgzxcRFhZctJMZOAY2kdLBBlFkHm5ZzgXZp+IFYRhVl+ykBZ6xOeUuBxosgO/2zZOSzOFvCnL32imH8Y= 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 1646402462194578.2198066317333; Fri, 4 Mar 2022 06:01:02 -0800 (PST) Received: from localhost ([::1]:45270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8UO-0001Dx-PA for importer@patchew.org; Fri, 04 Mar 2022 09:01:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <6053caf8bf8aa5544b14ec55d9b1518187b909df@lizzy.crudebyte.com>) id 1nQ7yQ-0003Zo-VT for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:27:59 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:40475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <6053caf8bf8aa5544b14ec55d9b1518187b909df@lizzy.crudebyte.com>) id 1nQ7yP-0006zR-JS for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:27:58 -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=E9U8f+CE/a5/AN3TPLs6/9FG2x5Jkw+GdC7Z0ig5vNY=; b=FmVFB /TCTXWlq9nIv5skFibbI+WDUqp6hoCjfzzfIzYBBH2UF4PhAiv/ilbbqXgbl6sf7XjwTOHKMd2pZr TILl6zlwsZawV+9lHkcavZS0owDqlTlaUlFnQhpoRt9tpAzq/mFcX7wiOT0lVv1YNTrAp272i8cug cxNU64AMANbYuNhlVDIoIabpZQA2vLgC8dXzQZH5Bu0pLxa/jsVjbGhUrpy++tqoSJu+OLX3Mh+66 J+lMaPehjpbdjhwcEtLoX1+OnG1JrmVGXbskTuIMo7S3GuAcVc+gurTohYXtr13wTs3E66PNktCNW rVmiPo9CZ27pPdMEsA++vbefr63xw==; Message-Id: <6053caf8bf8aa5544b14ec55d9b1518187b909df.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 06/19] 9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX 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=6053caf8bf8aa5544b14ec55d9b1518187b909df@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: 1646402463627100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer Signed-off-by: Keno Fischer Signed-off-by: Michael Roitzsch Because XATTR_SIZE_MAX is not defined on Darwin, create a cross-platform P9_XATTR_SIZE_MAX instead. [Will Cohen: - Adjust coding style - Lower XATTR_SIZE_MAX to 64k - Add explanatory context related to XATTR_SIZE_MAX] [Fabian Franz: - Move XATTR_SIZE_MAX reference from 9p.c to P9_XATTR_SIZE_MAX in 9p.h] Signed-off-by: Will Cohen Signed-off-by: Fabian Franz [Will Cohen: - For P9_XATTR_MAX, ensure that Linux uses XATTR_SIZE_MAX, Darwin uses 64k, and error out for undefined hosts] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-7-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p.c | 2 +- hw/9pfs/9p.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 14e84c3bcf..7405352c37 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3949,7 +3949,7 @@ static void coroutine_fn v9fs_xattrcreate(void *opaqu= e) rflags |=3D XATTR_REPLACE; } =20 - if (size > XATTR_SIZE_MAX) { + if (size > P9_XATTR_SIZE_MAX) { err =3D -E2BIG; goto out_nofid; } diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 1567b67841..94b273b3d0 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -479,4 +479,22 @@ struct V9fsTransport { void (*push_and_notify)(V9fsPDU *pdu); }; =20 +#if defined(XATTR_SIZE_MAX) +/* Linux */ +#define P9_XATTR_SIZE_MAX XATTR_SIZE_MAX +#elif defined(CONFIG_DARWIN) +/* + * Darwin doesn't seem to define a maximum xattr size in its user + * space header, so manually configure it across platforms as 64k. + * + * Having no limit at all can lead to QEMU crashing during large g_malloc() + * calls. Because QEMU does not currently support macOS guests, the below + * preliminary solution only works due to its being a reflection of the li= mit of + * Linux guests. + */ +#define P9_XATTR_SIZE_MAX 65536 +#else +#error Missing definition for P9_XATTR_SIZE_MAX for this host system +#endif + #endif --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646399748; cv=none; d=zohomail.com; s=zohoarc; b=eoUd+7G76tiN2cVgcxuP1Yb/jMjp96FXNTa7KZI/4HamgaEOKRHnsXFKy+62XoH7EgzSvSg5WULQmU50gEe87J54uzgPlvdBrU/84b33G2u8kIxlMSkNCGZlIWzbW1LB+QFzwWRNmOaV0PQxL5NtLgSLgf2pPec+h5An9jEViTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646399748; 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=89Gbgq/kest9e+BQG9UtS5uVE2I3QP9MTMPZSp2J16Y=; b=b96vRSTTcWs/yMP78ZLsZ8CVeVe1NcTXruXzhBGaQQlzkhh40qOQRO0zPMa/Z23J+yct/+SQ+8PNGmCozF20rsHnDTKg01WhYV5+cBaF34Vnhh9YN6bSiJ3YSzM2NinD211iA0Ru5dDiC6IiX4S3WDQvbz7Ycex3NUtMJ2Z5U7U= 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 1646399748413462.04933086890026; Fri, 4 Mar 2022 05:15:48 -0800 (PST) Received: from localhost ([::1]:46302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7md-0007xX-43 for importer@patchew.org; Fri, 04 Mar 2022 08:15:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7ip-0004qS-Ui for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:11:53 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:39217) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7io-0005P1-AY for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:11:51 -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=89Gbgq/kest9e+BQG9UtS5uVE2I3QP9MTMPZSp2J16Y=; b=edaZU IfAPjwEa+rdkMWgwALDavHIdvWJs87RlbPHzp8w/we8FOMNB82/lehxnxhGa+ZiEjE/h6IRIvjlMo IW2SEOsMxcwFfJLfJx0UPRHFScLruXLMv03tEl7m2wgy/ZB49Wg5sg34tNK1oKqEgdClfU5VS58NZ LlOHrFy5V5of0H7TolQgcPoDyiwJ/ccXcdxoHOvkoHCPpdp+WTyGBtFpF5VsZMV7IAfXx8h2v0+gH wjqH4Z19/5/NbkAU4Za12MK7G/reaY3LDSvz1Rh+/HWhitaWIsbR/OhCkvJAP8bS7UW4QKF6CmcLz YWNuym4JXITpKrHI/Ryl7AjH7Rhbw==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 07/19] 9p: darwin: *xattr_nofollow implementations 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=dcc0a6e2f98cecaa420e89b376bb685a80466d06@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: 1646399749455100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer This implements the darwin equivalent of the functions that were moved to 9p-util(-linux) earlier in this series in the new 9p-util-darwin file. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-8-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Acked-by: Christian Schoenebeck --- hw/9pfs/9p-util-darwin.c | 64 ++++++++++++++++++++++++++++++++++++++++ hw/9pfs/meson.build | 1 + 2 files changed, 65 insertions(+) create mode 100644 hw/9pfs/9p-util-darwin.c diff --git a/hw/9pfs/9p-util-darwin.c b/hw/9pfs/9p-util-darwin.c new file mode 100644 index 0000000000..cdb4c9e24c --- /dev/null +++ b/hw/9pfs/9p-util-darwin.c @@ -0,0 +1,64 @@ +/* + * 9p utilities (Darwin Implementation) + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/xattr.h" +#include "9p-util.h" + +ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *= name, + void *value, size_t size) +{ + int ret; + int fd =3D openat_file(dirfd, filename, + O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fgetxattr(fd, name, value, size, 0, 0); + close_preserve_errno(fd); + return ret; +} + +ssize_t flistxattrat_nofollow(int dirfd, const char *filename, + char *list, size_t size) +{ + int ret; + int fd =3D openat_file(dirfd, filename, + O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0); + if (fd =3D=3D -1) { + return -1; + } + ret =3D flistxattr(fd, list, size, 0); + close_preserve_errno(fd); + return ret; +} + +ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, + const char *name) +{ + int ret; + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fremovexattr(fd, name, 0); + close_preserve_errno(fd); + return ret; +} + +int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name, + void *value, size_t size, int flags) +{ + int ret; + int fd =3D openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0= ); + if (fd =3D=3D -1) { + return -1; + } + ret =3D fsetxattr(fd, name, value, size, 0, flags); + close_preserve_errno(fd); + return ret; +} diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build index 1b28e70040..12443b6ad5 100644 --- a/hw/9pfs/meson.build +++ b/hw/9pfs/meson.build @@ -14,6 +14,7 @@ fs_ss.add(files( 'coxattr.c', )) fs_ss.add(when: 'CONFIG_LINUX', if_true: files('9p-util-linux.c')) +fs_ss.add(when: 'CONFIG_DARWIN', if_true: files('9p-util-darwin.c')) fs_ss.add(when: 'CONFIG_XEN', if_true: files('xen-9p-backend.c')) softmmu_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss) =20 --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646400976; cv=none; d=zohomail.com; s=zohoarc; b=MlrdYQBvdpDquR2eOJoCkbD2sFGJaA8DWx32uCjc9mmCHPxLhC8ctjtUyNCkPWdKH2G3s/0UonVWlpQUVSQjC4vy9+kHxYQuwEqJO0t/3JIqXYzyX821mL3EiALWcpTbYPWggZqgjBmIi6eYeBTBjBuFCJ2F5wBGziOsQhYIEvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400976; 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=ecDSm2KPo+CRggTbcmt7kTibk+zlTy8+C8rBHzZ84Mc=; b=eAKSaw6gtZSR/vf6zAwTcCPnpvNj1sgTMb3mJ732RRPAJoinizGr3+o82F9hlXx6gDGmkASGQnDS+veMdIGcfM2B8lKPLLNVXtmSzvWqxCFqzMNGCbsFf9JvjNEjRE8dVtGqx8H9gYHhVvDNFJcMXxPfHdZu5Uu2fKbUKR3gL5c= 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 1646400976484803.4134061734406; Fri, 4 Mar 2022 05:36:16 -0800 (PST) Received: from localhost ([::1]:45574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ86S-0003AZ-0W for importer@patchew.org; Fri, 04 Mar 2022 08:36:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <41e44bc8e4e96608f89fdeca6e62f0b10261e731@lizzy.crudebyte.com>) id 1nQ7s9-0006Ce-18 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:21:33 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:35763) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <41e44bc8e4e96608f89fdeca6e62f0b10261e731@lizzy.crudebyte.com>) id 1nQ7s7-0001R5-Jj for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:21:28 -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=ecDSm2KPo+CRggTbcmt7kTibk+zlTy8+C8rBHzZ84Mc=; b=A/YG0 0c/Vceqr5sU2en/DwnsDOOlaZ5Y2MWOgQui4/3pl2rmNAP6tm502guzzDqWjJu51jYUoKsuQrrkqS MO/6dEGQCd45GT7jKCM7KxD5HBqVMgEi1mLXY8BhP3ZvfbzNyYuhN/AVjU1nAZUPtOYgrIg4YiqRX LEeiTMSJpB4mRlKDF37NEk0Dj0ZAU4F9nR840ueSAR4LRqLkpSVe5fWr1pULQLrz6HHiP4QLAiTH4 rdjBu3yS2w/QU9LcH9zu5QtbGjdnlRybGWKzyLS+cwZGVazF4nigiAAaoH51/W9Od/lD4Axq+xG2q tFspnxlGz77p1A0CwgvElLR82lqMw==; Message-Id: <41e44bc8e4e96608f89fdeca6e62f0b10261e731.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 08/19] 9p: darwin: Compatibility for f/l*xattr 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=41e44bc8e4e96608f89fdeca6e62f0b10261e731@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: 1646400978878100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer On darwin `fgetxattr` takes two extra optional arguments, and the l* variants are not defined (in favor of an extra flag to the regular variants. Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-9-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Acked-by: Christian Schoenebeck --- hw/9pfs/9p-local.c | 12 ++++++++---- hw/9pfs/9p-util.h | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index f3272f0b43..a0d08e5216 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -790,16 +790,20 @@ static int local_fstat(FsContext *fs_ctx, int fid_typ= e, mode_t tmp_mode; dev_t tmp_dev; =20 - if (fgetxattr(fd, "user.virtfs.uid", &tmp_uid, sizeof(uid_t)) > 0)= { + if (qemu_fgetxattr(fd, "user.virtfs.uid", + &tmp_uid, sizeof(uid_t)) > 0) { stbuf->st_uid =3D le32_to_cpu(tmp_uid); } - if (fgetxattr(fd, "user.virtfs.gid", &tmp_gid, sizeof(gid_t)) > 0)= { + if (qemu_fgetxattr(fd, "user.virtfs.gid", + &tmp_gid, sizeof(gid_t)) > 0) { stbuf->st_gid =3D le32_to_cpu(tmp_gid); } - if (fgetxattr(fd, "user.virtfs.mode", &tmp_mode, sizeof(mode_t)) >= 0) { + if (qemu_fgetxattr(fd, "user.virtfs.mode", + &tmp_mode, sizeof(mode_t)) > 0) { stbuf->st_mode =3D le32_to_cpu(tmp_mode); } - if (fgetxattr(fd, "user.virtfs.rdev", &tmp_dev, sizeof(dev_t)) > 0= ) { + if (qemu_fgetxattr(fd, "user.virtfs.rdev", + &tmp_dev, sizeof(dev_t)) > 0) { stbuf->st_rdev =3D le64_to_cpu(tmp_dev); } } else if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 2b9ac74291..9abff79884 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -19,6 +19,23 @@ #define O_PATH_9P_UTIL 0 #endif =20 +#ifdef CONFIG_DARWIN +#define qemu_fgetxattr(...) fgetxattr(__VA_ARGS__, 0, 0) +#define qemu_lgetxattr(...) getxattr(__VA_ARGS__, 0, XATTR_NOFOLLOW) +#define qemu_llistxattr(...) listxattr(__VA_ARGS__, XATTR_NOFOLLOW) +#define qemu_lremovexattr(...) removexattr(__VA_ARGS__, XATTR_NOFOLLOW) +static inline int qemu_lsetxattr(const char *path, const char *name, + const void *value, size_t size, int flags= ) { + return setxattr(path, name, value, size, 0, flags | XATTR_NOFOLLOW); +} +#else +#define qemu_fgetxattr fgetxattr +#define qemu_lgetxattr lgetxattr +#define qemu_llistxattr llistxattr +#define qemu_lremovexattr lremovexattr +#define qemu_lsetxattr lsetxattr +#endif + static inline void close_preserve_errno(int fd) { int serrno =3D errno; --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646401423; cv=none; d=zohomail.com; s=zohoarc; b=cLhnwNcLm7dbB/b0FDcZYBvJ3kqrhqFxv8YWItyOQvt17xMehvEhcz+ykZJTyJShXsTDeGxz374iLQNkFIGEqjsQp74ApXPHaaeHNPpISpTasanpRmYYSHfx5Bw7lxpkZIng1J3ZA6Hp0Kbj3yHzA624k5F/WQsr29yn0TwJtLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646401423; 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=ZLhjctf3DaE6G5VPiaCQu0lAdUS2EVV/reV2M8c9RTk=; b=OYRYI0qoEZ+2QZNzTUV794J7vjZ03+y/fweylLYr/0vEynKdF09d8JsoOe7/uCl/QEJU/Lx6EcEyliYponvA2arze9HPOKeTUNI1S10by/rgVS546BZTR/RbFX5TwIeKw8r0CyKBO//mpNJ3oKHYf87Jg4fDXf34NiTXT8BszlI= 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 164640142384138.94947096023145; Fri, 4 Mar 2022 05:43:43 -0800 (PST) Received: from localhost ([::1]:33628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8De-00063z-P5 for importer@patchew.org; Fri, 04 Mar 2022 08:43:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <24187e2b6419dbcb60f57ad204d3afdd0ac1b3a5@lizzy.crudebyte.com>) id 1nQ7uM-0008Lb-2k for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:23:51 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:36137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <24187e2b6419dbcb60f57ad204d3afdd0ac1b3a5@lizzy.crudebyte.com>) id 1nQ7uK-00049e-7B for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:23:45 -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=ZLhjctf3DaE6G5VPiaCQu0lAdUS2EVV/reV2M8c9RTk=; b=BLTBx Mabp+8COVKTzHFaStU8lYTBvUqlOabsp5AY4C2ukN7IOoYrIdWFkK6zLfiTn6TD0jXRrQ8K6He4Sv uNbuTxWTfg2fGA89On7/FQDErjaoNMpSkfKIKZaFKBOAGdIJ5tLB+Fsj68OqcrBEzg/BuZTDC1S3D Unn9LltNYOKZq/kE69F6wPJrrIMZ4MQdbjsGsRNFvytdNxiyUeKNaV5qM8ex0J+/3fiuL13ZgWv/p hiAU3MAVAEtMAC/DuOnOr7OxL0mJRj9ZERgXaI2MGidZcmr6lwbPuZyvefpbUlhKw74VQSRXr14Lk PtDxQntDKft7t4aQRZrba0ZiREOLA==; Message-Id: <24187e2b6419dbcb60f57ad204d3afdd0ac1b3a5.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 09/19] 9p: darwin: Implement compatibility for mknodat 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=24187e2b6419dbcb60f57ad204d3afdd0ac1b3a5@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: 1646401425390100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Keno Fischer Darwin does not support mknodat. However, to avoid race conditions with later setting the permissions, we must avoid using mknod on the full path instead. We could try to fchdir, but that would cause problems if multiple threads try to call mknodat at the same time. However, luckily there is a solution: Darwin includes a function that sets the cwd for the current thread only. This should suffice to use mknod safely. This function (pthread_fchdir_np) is protected by a check in meson in a patch later in this series. Signed-off-by: Keno Fischer Signed-off-by: Michael Roitzsch [Will Cohen: - Adjust coding style - Replace clang references with gcc - Note radar filed with Apple for missing syscall - Replace direct syscall with pthread_fchdir_np and adjust patch notes accordingly - Declare pthread_fchdir_np with - __attribute__((weak_import)) to allow checking for its presence before usage - Move declarations above cplusplus guard - Add CONFIG_PTHREAD_FCHDIR_NP to meson and check for presence in 9p-util - Rebase to apply cleanly on top of the 2022-02-10 changes to 9pfs - Fix line over 90 characters formatting error] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-10-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p-local.c | 4 ++-- hw/9pfs/9p-util-darwin.c | 33 +++++++++++++++++++++++++++++++++ hw/9pfs/9p-util-linux.c | 6 ++++++ hw/9pfs/9p-util.h | 11 +++++++++++ meson.build | 1 + 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index a0d08e5216..d42ce6d8b8 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -682,7 +682,7 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *dir= _path, =20 if (fs_ctx->export_flags & V9FS_SM_MAPPED || fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { - err =3D mknodat(dirfd, name, fs_ctx->fmode | S_IFREG, 0); + err =3D qemu_mknodat(dirfd, name, fs_ctx->fmode | S_IFREG, 0); if (err =3D=3D -1) { goto out; } @@ -697,7 +697,7 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *dir= _path, } } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || fs_ctx->export_flags & V9FS_SM_NONE) { - err =3D mknodat(dirfd, name, credp->fc_mode, credp->fc_rdev); + err =3D qemu_mknodat(dirfd, name, credp->fc_mode, credp->fc_rdev); if (err =3D=3D -1) { goto out; } diff --git a/hw/9pfs/9p-util-darwin.c b/hw/9pfs/9p-util-darwin.c index cdb4c9e24c..bec0253474 100644 --- a/hw/9pfs/9p-util-darwin.c +++ b/hw/9pfs/9p-util-darwin.c @@ -7,6 +7,8 @@ =20 #include "qemu/osdep.h" #include "qemu/xattr.h" +#include "qapi/error.h" +#include "qemu/error-report.h" #include "9p-util.h" =20 ssize_t fgetxattrat_nofollow(int dirfd, const char *filename, const char *= name, @@ -62,3 +64,34 @@ int fsetxattrat_nofollow(int dirfd, const char *filename= , const char *name, close_preserve_errno(fd); return ret; } + +/* + * As long as mknodat is not available on macOS, this workaround + * using pthread_fchdir_np is needed. + * + * Radar filed with Apple for implementing mknodat: + * rdar://FB9862426 (https://openradar.appspot.com/FB9862426) + */ +#if defined CONFIG_PTHREAD_FCHDIR_NP + +int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev) +{ + int preserved_errno, err; + if (!pthread_fchdir_np) { + error_report_once("pthread_fchdir_np() not available on this versi= on of macOS"); + return -ENOTSUP; + } + if (pthread_fchdir_np(dirfd) < 0) { + return -1; + } + err =3D mknod(filename, mode, dev); + preserved_errno =3D errno; + /* Stop using the thread-local cwd */ + pthread_fchdir_np(-1); + if (err < 0) { + errno =3D preserved_errno; + } + return err; +} + +#endif diff --git a/hw/9pfs/9p-util-linux.c b/hw/9pfs/9p-util-linux.c index 398614a5d0..db451b0784 100644 --- a/hw/9pfs/9p-util-linux.c +++ b/hw/9pfs/9p-util-linux.c @@ -61,4 +61,10 @@ int fsetxattrat_nofollow(int dirfd, const char *filename= , const char *name, ret =3D lsetxattr(proc_path, name, value, size, flags); g_free(proc_path); return ret; + +} + +int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev) +{ + return mknodat(dirfd, filename, mode, dev); } diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 9abff79884..1f74d37558 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -112,5 +112,16 @@ static inline off_t qemu_dirent_off(struct dirent *den= t) #endif } =20 +/* + * As long as mknodat is not available on macOS, this workaround + * using pthread_fchdir_np is needed. qemu_mknodat is defined in + * os-posix.c. pthread_fchdir_np is weakly linked here as a guard + * in case it disappears in future macOS versions, because it is + * is a private API. + */ +#if defined CONFIG_DARWIN && defined CONFIG_PTHREAD_FCHDIR_NP +int pthread_fchdir_np(int fd) __attribute__((weak_import)); +#endif +int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev); =20 #endif diff --git a/meson.build b/meson.build index a5b63e62cd..6058ea3896 100644 --- a/meson.build +++ b/meson.build @@ -1622,6 +1622,7 @@ config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has= _function('posix_fallocate' config_host_data.set('CONFIG_POSIX_MEMALIGN', cc.has_function('posix_memal= ign')) config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#= include ')) +config_host_data.set('CONFIG_PTHREAD_FCHDIR_NP', cc.has_function('pthread_= fchdir_np')) config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwai= t', dependencies: threads)) config_host_data.set('CONFIG_SENDFILE', cc.has_function('sendfile')) config_host_data.set('CONFIG_SETNS', cc.has_function('setns') and cc.has_f= unction('unshare')) --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646402175; cv=none; d=zohomail.com; s=zohoarc; b=MpNTOErMmzPsSU6QDww9UxhNhYMJz/TMOkfTwrAd4/WvqGn4iwztc1LTVnv/gS2o+fcqSKoOT2jSP/asvl91TKg+39+Qxu3ZDgayWwgo0zdctuvEuA6fDbwO/NYkx7op7piNEcL8lx8p1wdJ4Q20X/lQiKY2oSpN1af2DRAQb7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646402175; 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=yKS8v7D5O2e+Blqy1u72eKRpQqfklC5OzihiNL/eqwU=; b=m1QGpHU6fvYx3OteFQe2FFHSRum7/0QhtMdY5O6DtxT/uSXMA9tr1C17WbwnGR9htYVnLve+4Sfeg7tcykcX+mMVPEsovFFkqggS0lOhiZJ+0eawRJsTumzDWDIY/0vOUJ0rsn/78hC3s02xmf2zXOwCUQ0r+lupPLgA3MZft8g= 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 1646402175664501.8474455365956; Fri, 4 Mar 2022 05:56:15 -0800 (PST) Received: from localhost ([::1]:36860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8Pn-0003FR-63 for importer@patchew.org; Fri, 04 Mar 2022 08:56:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <71f51f31342fa9b3eb53ff267345ee9d59d0cebf@lizzy.crudebyte.com>) id 1nQ7xP-0002I5-O1 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:27:00 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:34357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <71f51f31342fa9b3eb53ff267345ee9d59d0cebf@lizzy.crudebyte.com>) id 1nQ7xO-0006rB-6j for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:26:55 -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=yKS8v7D5O2e+Blqy1u72eKRpQqfklC5OzihiNL/eqwU=; b=kbUaJ tq/SkeMBtW9MroiHKzUY0CJyu6zTqfb/eaaL2V5innyZ1v6PY3St4Bg7RXP717AOATQKyoN2FiH1M b7W2ndiTd2qiU0TLaIX+VNz7O18suNwCWhtBuuS3+DvFpux5u5eDWzrD1PR8y+b7K3d1f6LHZU13V rSJTwVzU+HN0dhBsQYh/PmBB+azdZPLpYhFpUzvueNT0Vbd3Nfo6QGqDpgSOq0UqFvdAkg/KPB9E1 jI6FnJxp7UO1kUib3ftcTwCwXZPkaXWwQDwhNWFexInCC/JttaFMDwPrFw+G0JcrufhFbqbb/MFxB SAfcq98xOr5ww02hYxrdV/dekUiaA==; Message-Id: <71f51f31342fa9b3eb53ff267345ee9d59d0cebf.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 10/19] 9p: darwin: Adjust assumption on virtio-9p-test 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=71f51f31342fa9b3eb53ff267345ee9d59d0cebf@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: 1646402177537100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Will Cohen The previous test depended on the assumption that P9_DOTL_AT_REMOVEDIR and AT_REMOVEDIR have the same value. While this is true on Linux, it is not true everywhere, and leads to an incorrect test failure on unlink_at, noticed when adding 9p to darwin: Received response 7 (RLERROR) instead of 77 (RUNLINKAT) Rlerror has errno 22 (Invalid argument) ** ERROR:../tests/qtest/virtio-9p-test.c:305:v9fs_req_recv: assertion failed (hdr.id =3D=3D id): (7 =3D=3D 77) Bail out! ERROR:../tests/qtest/virtio-9p-test.c:305:v9fs_req_recv: assertion failed (hdr.id =3D=3D id): (7 =3D=3D 77) Signed-off-by: Fabian Franz [Will Cohen: - Add explanation of patch and description of pre-patch test failure] Signed-off-by: Will Cohen Acked-by: Thomas Huth [Will Cohen: - Move this patch before 9p: darwin: meson patch to avoid qtest breakage during bisecting] Signed-off-by: Will Cohen Reviewed-by: Greg Kurz Message-Id: <20220227223522.91937-11-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck --- tests/qtest/virtio-9p-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 502e5ad0c7..01ca076afe 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -1253,7 +1253,7 @@ static void fs_unlinkat_dir(void *obj, void *data, QG= uestAllocator *t_alloc) /* ... and is actually a directory */ g_assert((st.st_mode & S_IFMT) =3D=3D S_IFDIR); =20 - do_unlinkat(v9p, "/", "02", AT_REMOVEDIR); + do_unlinkat(v9p, "/", "02", P9_DOTL_AT_REMOVEDIR); /* directory should be gone now */ g_assert(stat(new_dir, &st) !=3D 0); } --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646400576; cv=none; d=zohomail.com; s=zohoarc; b=bvcWG/H835Ycyi/WYBNuHi84Pk/Jj1FlHSnHfiTUGalPT2Cv7UPswbyg2b43ghZfAH4EJbbanyFUO5fU8ZXVEXzIeU7VutrmaMzHXhATqrNJ3coJsxfx0/0TM5VTsNP0+Lkwkv0N9TL949RZSE/DpDOcjzUjlIA5kIFntJ4N3M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400576; 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=Q94IelAKNmCVG45pk6xOpYWDWfr2/ub/y51UkPeP0WQ=; b=V69gf/xvD20LBQXjK8YsQfGuUgwAOfMmdmzl7dEJQ1kO8vEvryj9XRopVGbp/2pnKSa5XSMzD6EaaPamiH7tRPRRT0gUDFJ+AsUIxwZll7kI0Jvut2Ri96cHYu8r4rB8x8Os8S3WI9iwM7UJFSoxGNYOcqo16MSKzD11EDbuGWc= 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 1646400575997233.74179496730926; Fri, 4 Mar 2022 05:29:35 -0800 (PST) Received: from localhost ([::1]:35450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7zy-00040l-PD for importer@patchew.org; Fri, 04 Mar 2022 08:29:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7oz-0002fX-25 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:18:13 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:54351) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7ox-0006qm-GL for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:18:12 -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=Q94IelAKNmCVG45pk6xOpYWDWfr2/ub/y51UkPeP0WQ=; b=m18RB x+zPRJFmeu1754WC9HFQcrFA0LQztvinvIF9QOpTCwUeZxXN/rj0Hv4a0Ypb/YDdr7hG7Ttr+Elh5 NR9dM11kgiKlwuzKlA90h0ZXvihdf76Sw6Lb+hNnjS8dkP7mMyxGsKanOQFPhKNlOrpuzOungKFgc 6BhvT2W9oJr8nLTX0bUtIxVZ8u/RW8p3Sx4j26apvUnNrj1uDotrWk1RLiRBdMhoowxo+tQGUCD44 2DjhkTeDsaTesdOIlaxqZZUz85dOO7bWOCMj1R4tH6CytxDVsRYSWy95xdIGJoQDdgGXqUVciudtm 1Yow1siJjEcoQlX7QtprHtibiSQYQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 11/19] 9p: darwin: meson: Allow VirtFS on Darwin 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=c798533fa748f8c8006ef3372905da6ba99da2fd@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: 1646400576583100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 - Fully adjust meson virtfs error note to specify macOS - Rebase to master] Signed-off-by: Will Cohen Message-Id: <20220227223522.91937-12-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Acked-by: Christian Schoenebeck --- fsdev/meson.build | 1 + meson.build | 12 +++++++----- 2 files changed, 8 insertions(+), 5 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 6058ea3896..32d91690ee 100644 --- a/meson.build +++ b/meson.build @@ -1462,14 +1462,16 @@ dbus_display =3D get_option('dbus_display') \ .allowed() =20 have_virtfs =3D get_option('virtfs') \ - .require(targetos =3D=3D 'linux', - error_message: 'virtio-9p (virtfs) requires Linux') \ - .require(libattr.found() and libcap_ng.found(), - error_message: 'virtio-9p (virtfs) requires libcap-ng-devel a= nd libattr-devel') \ + .require(targetos =3D=3D 'linux' or targetos =3D=3D 'darwin', + error_message: 'virtio-9p (virtfs) requires Linux or macOS') \ + .require(targetos =3D=3D 'linux' or cc.has_function('pthread_fchdir_np= '), + error_message: 'virtio-9p (virtfs) on macOS requires the pres= ence of pthread_fchdir_np') \ + .require(targetos =3D=3D 'darwin' or (libattr.found() and libcap_ng.fo= und()), + error_message: 'virtio-9p (virtfs) on Linux requires libcap-n= g-devel and libattr-devel') \ .disable_auto_if(not have_tools and not have_system) \ .allowed() =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 foreach k : get_option('trace_backends') config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true) --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646402285; cv=none; d=zohomail.com; s=zohoarc; b=FJpmGxpKcd1UrtdklqHxpalzfRNfDcmMB9hcObFmCucd2JjLHFDuDBVWxrsq/5yLhidHtaedyPpOfXBEDF5POwfNVITpVuApwofmPiC4684M/Uv7hmNbiUSsfdfRAXQ/C/vWnl0mJNzuObW2lzqlrvgJyNUgLnE62CbLVYv3Gps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646402285; 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=wKRLqcpkp3yI/9Y7vn9Lc/2LYzsAf401uXfH337cbsY=; b=bV7KY6Cr4FMJgRYjsBRLY4SeLObtNEQCWpwbjvyWAx37SeQo5i+bQP6dAhgj3uBAAhbeZ9k/GTj5Wy1evnoTCzr+tS26ImVoIYzJAty3InLlBq0JYR3H7tMuiso/z8THs2bSRM2frzpUWnoEpSwuOihinWVlX451NKN3zcesKg4= 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 1646402285082768.4936856729609; Fri, 4 Mar 2022 05:58:05 -0800 (PST) Received: from localhost ([::1]:39510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8RY-0005EG-3J for importer@patchew.org; Fri, 04 Mar 2022 08:58:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4115c7e2bf14bb1a44914ed3fd35a49acb9d270d@lizzy.crudebyte.com>) id 1nQ81V-0006MM-Dt for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:31:13 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:52277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4115c7e2bf14bb1a44914ed3fd35a49acb9d270d@lizzy.crudebyte.com>) id 1nQ81T-0007Yp-NM for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:31:09 -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=wKRLqcpkp3yI/9Y7vn9Lc/2LYzsAf401uXfH337cbsY=; b=BZohK ZiMRCwh8vSnSB+hPVFmL3tcFJU4dXdexRe8MC0lqSZc2yt2bzGzEP9od4rAfViA0UNiD1NVjUcTFV GdDtx5rYrL0/WgQt65WqCEDnd8OFKGnWoW4Jk/ayEn2MbbbeA0qssjFWyV5MxyNq9w5gEbZeTZ5Bm qB1EpshG1qCUfC56eIdwJm2eSvOYJw/sqTQpc6eXCLuIbHifk0B1rd1L/omKcXAcdGLyKUKXKhIAi 1y5guB/4rvSVrPI793EeXV/D85lzlPf6FgTV+skwHrSimg6KuRePbEgOop+x1cfzz5+fcDrP7Qxd1 Q56wIyXJOd7554BSPUBoPIlyPby1w==; Message-Id: <4115c7e2bf14bb1a44914ed3fd35a49acb9d270d.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 12/19] 9pfs: move qemu_dirent_dup() from osdep -> 9p-util 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=4115c7e2bf14bb1a44914ed3fd35a49acb9d270d@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: 1646402286497100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Function qemu_dirent_dup() is currently only used by 9pfs server, so move it from project global header osdep.h to 9pfs specific header 9p-util.h. Link: https://lore.kernel.org/qemu-devel/CAFEAcA_=3DHAUNomKD2wurSVaAHa5mrk2= 2A1oHKLWUDjk7v6Khmg@mail.gmail.com/ Based-on: <20220227223522.91937-12-wwcohen@gmail.com> Signed-off-by: Christian Schoenebeck Reviewed-by: Peter Maydell Message-Id: --- hw/9pfs/9p-util.h | 30 ++++++++++++++++++++++++++++++ include/qemu/osdep.h | 13 ------------- util/osdep.c | 21 --------------------- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 1f74d37558..8b92614e6c 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -112,6 +112,36 @@ static inline off_t qemu_dirent_off(struct dirent *den= t) #endif } =20 +/** + * Duplicate directory entry @dent. + * + * It is highly recommended to use this function instead of open coding + * duplication of @c dirent objects, because the actual @c struct @c dirent + * size may be bigger or shorter than @c sizeof(struct dirent) and correct + * handling is platform specific (see gitlab issue #841). + * + * @dent - original directory entry to be duplicated + * @returns duplicated directory entry which should be freed with g_free() + */ +static inline struct dirent *qemu_dirent_dup(struct dirent *dent) +{ + size_t sz =3D 0; +#if defined _DIRENT_HAVE_D_RECLEN + /* Avoid use of strlen() if platform supports d_reclen. */ + sz =3D dent->d_reclen; +#endif + /* + * Test sz for zero even if d_reclen is available + * because some drivers may set d_reclen to zero. + */ + if (sz =3D=3D 0) { + /* Fallback to the most portable way. */ + sz =3D offsetof(struct dirent, d_name) + + strlen(dent->d_name) + 1; + } + return g_memdup(dent, sz); +} + /* * As long as mknodat is not available on macOS, this workaround * using pthread_fchdir_np is needed. qemu_mknodat is defined in diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 7bcce3bceb..650ba1aa50 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -673,19 +673,6 @@ static inline int platform_does_not_support_system(con= st char *command) } #endif /* !HAVE_SYSTEM_FUNCTION */ =20 -/** - * Duplicate directory entry @dent. - * - * It is highly recommended to use this function instead of open coding - * duplication of @c dirent objects, because the actual @c struct @c dirent - * size may be bigger or shorter than @c sizeof(struct dirent) and correct - * handling is platform specific (see gitlab issue #841). - * - * @dent - original directory entry to be duplicated - * @returns duplicated directory entry which should be freed with g_free() - */ -struct dirent *qemu_dirent_dup(struct dirent *dent); - #ifdef __cplusplus } #endif diff --git a/util/osdep.c b/util/osdep.c index 723cdcb004..7c4deda6fe 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -33,7 +33,6 @@ extern int madvise(char *, size_t, int); #endif =20 -#include #include "qemu-common.h" #include "qemu/cutils.h" #include "qemu/sockets.h" @@ -619,23 +618,3 @@ writev(int fd, const struct iovec *iov, int iov_cnt) return readv_writev(fd, iov, iov_cnt, true); } #endif - -struct dirent * -qemu_dirent_dup(struct dirent *dent) -{ - size_t sz =3D 0; -#if defined _DIRENT_HAVE_D_RECLEN - /* Avoid use of strlen() if platform supports d_reclen. */ - sz =3D dent->d_reclen; -#endif - /* - * Test sz for zero even if d_reclen is available - * because some drivers may set d_reclen to zero. - */ - if (sz =3D=3D 0) { - /* Fallback to the most portable way. */ - sz =3D offsetof(struct dirent, d_name) + - strlen(dent->d_name) + 1; - } - return g_memdup(dent, sz); -} --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646399627; cv=none; d=zohomail.com; s=zohoarc; b=fvpHCQRlsZabW9a8BmCVRbCjz1Uvxc/xzURPtTrmflvyGiLrVQU5zrwXnM/B9ewbA1ps2p3sW+9GssffO3+f5Cl6BZd84Ut4j0K4aAdMdsln3/2FDKRTjB0TXX37GhBG/mamq6ClcZi4yV6oBpT4/4AF7U9uwKUS8dd1jpUP2v4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646399627; 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=E+pi20wm1t2lPx1rR3N1oRcogOjxzufykFPyJrnQBdE=; b=URWJSugzFgtzGyuxs3Hw+7pd2dDPyNWoM+Civ0BKOhXNYAV5q2nNlxoIcSXc726QU/7rzTaFEXJwcGmLMXtnagpeECKZpB19ZqocQLEnFu+O3T2VIsBsw5514dRnWI+1by1Y7vpcC9ficpSNv93OgNuN8RrGb+reUBHmsYcuOpY= 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 1646399627748956.6428288769049; Fri, 4 Mar 2022 05:13:47 -0800 (PST) Received: from localhost ([::1]:44042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7kh-0006SU-2b for importer@patchew.org; Fri, 04 Mar 2022 08:13:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <878a1c85e3d1345bff4df30a5158a94db0d29587@lizzy.crudebyte.com>) id 1nQ7hp-0003sW-1T for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:10:49 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:36249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <878a1c85e3d1345bff4df30a5158a94db0d29587@lizzy.crudebyte.com>) id 1nQ7hn-00051f-2p for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:10:48 -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=E+pi20wm1t2lPx1rR3N1oRcogOjxzufykFPyJrnQBdE=; b=o14Pq LLqknMemkXj30e6mYSZyt6vqYcsScEWiVgt14lw+JOP8QKLbATUdKUF3nMueu5BYSym+Jki1A+tTd M8w0BlcbcsPZaZ9rsYsfAa5UWqK68eVS0VdTwo10PVUOwnp/0HEWae3BAp+23W4l2xDBARwYOGMLY DgTELx/dwNOgVRhTm4RDu5j6mgMemMZIvbTDH677E1qJaqKUEIelWrmcQ9M/wWCohIGpYm826p1T3 uU4350jzxMOxcnrWK7wFSWBDKSWsVA2ZDdXML7qu8hg7UobrRkJNWeVrnNaV8nji1nfrDP9r/gfA/ V9NojzlDltUOT4Ra4UX3A59zDUKFg==; Message-Id: <878a1c85e3d1345bff4df30a5158a94db0d29587.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 13/19] 9pfs: drop Doxygen format from qemu_dirent_dup() API comment 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=878a1c85e3d1345bff4df30a5158a94db0d29587@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: 1646399630663100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so drop occurrences of "@c" which is Doxygen format for fixed-width text. Link: https://lore.kernel.org/qemu-devel/CAFEAcA89+ENOM6x19OEF53Kd2DWkhN5SN= 21Va0D7yepJSa3Jyg@mail.gmail.com/ Based-on: Signed-off-by: Christian Schoenebeck Reviewed-by: Peter Maydell Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 8b92614e6c..22835c5f61 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -116,8 +116,8 @@ static inline off_t qemu_dirent_off(struct dirent *dent) * Duplicate directory entry @dent. * * It is highly recommended to use this function instead of open coding - * duplication of @c dirent objects, because the actual @c struct @c dirent - * size may be bigger or shorter than @c sizeof(struct dirent) and correct + * duplication of dirent objects, because the actual struct dirent + * size may be bigger or shorter than sizeof(struct dirent) and correct * handling is platform specific (see gitlab issue #841). * * @dent - original directory entry to be duplicated --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646401856; cv=none; d=zohomail.com; s=zohoarc; b=mAEggoayiLnxx2hiio2WDgj6SJmRIG8HVegLSHZTLDqdG8aGsAkNUFhIUJ/mXLZ0ZstvTXsD7gXSqwtAzs+lW8KeeZgvoDXh+ykvBWNjEsSK1InSxix7yuoAgoBsoVd/LCT0woPamv4/q+UVQVYehTzRNX+tuMfva1PeVd+HVq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646401856; 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=xcMKupBZTTL5NgBB0GSoIFyvqJ9eeQK3NYRIyylRKDs=; b=mGeX1hFxcm/GypAyZIFXxX3MtsNgstEucw0MIkniP+1qDaZDRgeBG+NC/51m59iwld4akkZfymnxDuwmeTNNyUujeVauY7/LQG21+H+P00mjkH5Be+cOrBJMedO/4Fkf+1IocKspn7xVYWFTmZmaPZ7ALSVtupVJz+XLSKcTGko= 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 1646401856235361.2164249671408; Fri, 4 Mar 2022 05:50:56 -0800 (PST) Received: from localhost ([::1]:50658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ8Kc-0001Fc-TG for importer@patchew.org; Fri, 04 Mar 2022 08:50:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7zR-0004jt-7z for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:29:02 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:37219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7zP-0007BT-Ra for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:29:00 -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=xcMKupBZTTL5NgBB0GSoIFyvqJ9eeQK3NYRIyylRKDs=; b=h00ae sd/9kWUYw/21gp500Pghk0l5VtTBBfEUKc8sUgBvif7M69omjKNphg5jDqEOUP4Nb8XcmefIFyX4e QazoYGMO+QyRAKwbjTkI/wGpTYoIkty4P9j7q0+kwYJsm6+KRCaIJ6cxFNFnMK/P+Q+ELHWiKqUm/ GPrrf0KZxiJWGSZmeNj0avRlHW3xt5SPZFf58/P2k36vkN7ucYRuC2sOLFSTP7bgEWl01Zh8loLPB zH51YkLqeTYHDAO4ICKaQnAJfK5u6r3t1sigoZ/ZvK8hnAUB1QBXdUmHMBICzQ3feVW9rxT3IT5cl t8b6YYz/oKyNUAlK2MtVQeA3c065g==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 14/19] 9pfs/9p.h: convert Doxygen -> kerneldoc format 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=c2ae4952afd4f0bab98cd6e2803b5190804f52ad@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: 1646401857235100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so convert API doc comments from Doxygen format to kerneldoc format. Based-on: Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <2b8f91de7bac3d3bc85d60eb08830a35a394be75.1646314856.git.qemu_o= ss@crudebyte.com> --- hw/9pfs/9p.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 94b273b3d0..af2635fae9 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -100,8 +100,8 @@ typedef enum P9ProtoVersion { V9FS_PROTO_2000L =3D 0x02, } P9ProtoVersion; =20 -/** - * @brief Minimum message size supported by this 9pfs server. +/* + * Minimum message size supported by this 9pfs server. * * A client establishes a session by sending a Tversion request along with= a * 'msize' parameter which suggests the server a maximum message size ever= to be @@ -231,7 +231,7 @@ static inline void v9fs_readdir_init(P9ProtoVersion pro= to_version, V9fsDir *dir) } } =20 -/** +/* * Type for 9p fs drivers' (a.k.a. 9p backends) result of readdir requests, * which is a chained list of directory entries. */ @@ -289,8 +289,8 @@ typedef enum AffixType_t { AffixType_Suffix, /* A.k.a. postfix. */ } AffixType_t; =20 -/** - * @brief Unique affix of variable length. +/* + * Unique affix of variable length. * * An affix is (currently) either a suffix or a prefix, which is either * going to be prepended (prefix) or appended (suffix) with some other @@ -304,7 +304,7 @@ typedef struct VariLenAffix { AffixType_t type; /* Whether this affix is a suffix or a prefix. */ uint64_t value; /* Actual numerical value of this affix. */ /* - * Lenght of the affix, that is how many (of the lowest) bits of @c va= lue + * Lenght of the affix, that is how many (of the lowest) bits of ``val= ue`` * must be used for appending/prepending this affix to its final resul= ting, * unique number. */ --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646399972; cv=none; d=zohomail.com; s=zohoarc; b=Lz0R66VVLFfDrnoeuO32eEa18S4ZhhRt9Un62cqCaUf9GQKUQNyscBBXK1Sa/P09A13/YFN2nQQsi+Dh5hxoiW5+apZ976RbZev1BhBiII2guTeqOWBeMtGkNs4Kp5azJhQEge5P0XMfw6tPiLfuNKL/pYLyxVbHmaf4IXzTVQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646399972; 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=Vl2X3WYggHpA/TJOsUhXcKaCskBk2BTJ7HU+dytgZhY=; b=Y+lTOW71y8yiWMHGYMQuEcn26Za14gBX1NLG6LGX1XEEqbfrSsBOoKZAMYtOMihv7acuZ1wiXrgak4+qUhmbW0F7+lvwNQU1Me/Dw3Nljxzb7TS/qkTVbIynZygedm3Ktma/i4RtWz7Ib2xQY/3/QB7sUGR5SzCZMhdSz6VfyXQ= 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 1646399972238109.29490261720139; Fri, 4 Mar 2022 05:19:32 -0800 (PST) Received: from localhost ([::1]:50940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7qF-0002oq-7L for importer@patchew.org; Fri, 04 Mar 2022 08:19:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7jr-0006Me-8e for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:12:56 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:59547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7jo-0005dK-S3 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:12:54 -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=Vl2X3WYggHpA/TJOsUhXcKaCskBk2BTJ7HU+dytgZhY=; b=cVdug yZJiwQy1Hd4qndYeokkE1HqG1on59KiiAj4o+ROSiYDJkM06CBjEvge/2uncbHZb2RAFnxVLWgyTL KErT7sWcn0YBxG53x7zM+j+1g6hYlMP/+d/ABpO7auBVoJoPkCPtoEObewwGQrkI3rw3eykKFWcvJ XIMRQCcPmL0PVWjZrcBCrhpht0fJfZNP3Scgn1bgj05EsqDUm7WrzVDnTEomqm+quPhBwWezEQ8D2 0gUlKCHV6g5pAR6L2snGGCwzrWU5IWWjBaBIYPE73XWuIC0o+NgbtIcRUawO1mFbvc+dm9Br19nq4 U6T6P0fV1Ct9QD9cbX5Vu9GQIbMcg==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 15/19] 9pfs/codir.c: convert Doxygen -> kerneldoc format 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=cee3e110958141446de1fbd5074fb03f0492c878@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: 1646399972654100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so convert API doc comments from Doxygen format to kerneldoc format. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/codir.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index f96d8ac4e6..75148bc985 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -184,14 +184,25 @@ out: } =20 /** - * @brief Reads multiple directory entries in one rush. + * v9fs_co_readdir_many() - Reads multiple directory entries in one rush. + * + * @pdu: the causing 9p (T_readdir) client request + * @fidp: already opened directory where readdir shall be performed on + * @entries: output for directory entries (must not be NULL) + * @offset: initial position inside the directory the function shall + * seek to before retrieving the directory entries + * @maxsize: maximum result message body size (in bytes) + * @dostat: whether a stat() should be performed and returned for + * each directory entry + * Return: resulting response message body size (in bytes) on success, + * negative error code otherwise * * Retrieves the requested (max. amount of) directory entries from the fs * driver. This function must only be called by the main IO thread (top ha= lf). * Internally this function call will be dispatched to a background IO thr= ead * (bottom half) where it is eventually executed by the fs driver. * - * @discussion Acquiring multiple directory entries in one rush from the fs + * Acquiring multiple directory entries in one rush from the fs * driver, instead of retrieving each directory entry individually, is very * beneficial from performance point of view. Because for every fs driver * request latency is added, which in practice could lead to overall @@ -199,20 +210,9 @@ out: * directory) if every directory entry was individually requested from fs * driver. * - * @note You must @b ALWAYS call @c v9fs_free_dirents(entries) after calli= ng + * NOTE: You must ALWAYS call v9fs_free_dirents(entries) after calling * v9fs_co_readdir_many(), both on success and on error cases of this - * function, to avoid memory leaks once @p entries are no longer needed. - * - * @param pdu - the causing 9p (T_readdir) client request - * @param fidp - already opened directory where readdir shall be performed= on - * @param entries - output for directory entries (must not be NULL) - * @param offset - initial position inside the directory the function shall - * seek to before retrieving the directory entries - * @param maxsize - maximum result message body size (in bytes) - * @param dostat - whether a stat() should be performed and returned for - * each directory entry - * @returns resulting response message body size (in bytes) on success, - * negative error code otherwise + * function, to avoid memory leaks once @entries are no longer needed. */ int coroutine_fn v9fs_co_readdir_many(V9fsPDU *pdu, V9fsFidState *fidp, struct V9fsDirEnt **entries, --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646400483; cv=none; d=zohomail.com; s=zohoarc; b=IAmAbMt5XPmkJuCwfSIka4GswloxBFW6ZbSc0dUnAItGpb5Oek9mzgJGr2I0yLsiyuTrluZyNEd6U6Zx2V6af7q5fguAADAGfgamvN767LoHRa07fqJwDPS686qHIRropyAveLaHbuoO1PvAWsLxRR3DeGNcRNFokGY556tFzNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400483; 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=JxwJG9r+Tf4XE67kO24LxoQgtYGtj/d4r4gjFVEHVJ0=; b=hj2zckAIyjzMuC2gALi/UuZtc712W4jv9vyjUDwloNy69GERCHhNprEWeuK8DF9ukyrQYMidM3I7f5/3K29J2jZFDaf7m7l1W47LLkIYOQlDzYReYr+McrUBJ6DjBtgLBGNIrpG/6efJbK4AR/pPXjdrVEO0oViWYUK+mwyFf+k= 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 1646400483763478.561835390626; Fri, 4 Mar 2022 05:28:03 -0800 (PST) Received: from localhost ([::1]:33032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7yT-0002Fh-FT for importer@patchew.org; Fri, 04 Mar 2022 08:28:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7ny-00028A-KR for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:17:10 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:40543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7nw-0006eX-Q1 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:17:10 -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=JxwJG9r+Tf4XE67kO24LxoQgtYGtj/d4r4gjFVEHVJ0=; b=EbYSN /2z0D6rBYGT1ab7aVZlXdohokawTPeVnO8m4bcFwAbn1EhX2oXq6dmlkQSYq/sZIxtu2Sjlcg61rR RsLtR3aXy9+o2A5CzIGiw4wCyo1KzVW2jIDF88vFSNjc3CykAEwD2UlLsfOACPIO4YbzFXyNFiKzg f41OTEs5JtDRKIV4FDjRY8tBkJOYMIsQeGeEgw8z19EKbaKgZN4BVBrJk6qCvOVO9gvo0P2I842e9 GYACnJliDMYRO0LXHOQn9QNosyK0/Pe2ZgWX5HartdGBdbPKQrj6Crc7MYm6HwuY2ga36B68enXOu E3HY1MwOO5j8kGhSJYVjZyKc9fTqg==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 16/19] 9pfs/9p.c: convert Doxygen -> kerneldoc format 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=a0df9b2f440c068979769762fdd5a853156fcccb@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: 1646400485816100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so convert API doc comments from Doxygen format to kerneldoc format. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <4ece6ffa4465c271c6a7c42a3040f42780fcce87.1646314856.git.qemu_o= ss@crudebyte.com> --- hw/9pfs/9p.c | 62 +++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 7405352c37..a6d6b3f835 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -628,8 +628,8 @@ static inline uint64_t mirror64bit(uint64_t value) ((uint64_t)mirror8bit((value >> 56) & 0xff)); } =20 -/** - * @brief Parameter k for the Exponential Golomb algorihm to be used. +/* + * Parameter k for the Exponential Golomb algorihm to be used. * * The smaller this value, the smaller the minimum bit count for the Exp. * Golomb generated affixes will be (at lowest index) however for the @@ -642,28 +642,30 @@ static inline uint64_t mirror64bit(uint64_t value) * should be small, for a large amount of devices k might be increased * instead. The default of k=3D0 should be fine for most users though. * - * @b IMPORTANT: In case this ever becomes a runtime parameter; the value = of + * IMPORTANT: In case this ever becomes a runtime parameter; the value of * k should not change as long as guest is still running! Because that wou= ld * cause completely different inode numbers to be generated on guest. */ #define EXP_GOLOMB_K 0 =20 /** - * @brief Exponential Golomb algorithm for arbitrary k (including k=3D0). + * expGolombEncode() - Exponential Golomb algorithm for arbitrary k + * (including k=3D0). * - * The Exponential Golomb algorithm generates @b prefixes (@b not suffixes= !) + * @n: natural number (or index) of the prefix to be generated + * (1, 2, 3, ...) + * @k: parameter k of Exp. Golomb algorithm to be used + * (see comment on EXP_GOLOMB_K macro for details about k) + * Return: prefix for given @n and @k + * + * The Exponential Golomb algorithm generates prefixes (NOT suffixes!) * with growing length and with the mathematical property of being * "prefix-free". The latter means the generated prefixes can be prepended * in front of arbitrary numbers and the resulting concatenated numbers are * guaranteed to be always unique. * * This is a minor adjustment to the original Exp. Golomb algorithm in the - * sense that lowest allowed index (@param n) starts with 1, not with zero. - * - * @param n - natural number (or index) of the prefix to be generated - * (1, 2, 3, ...) - * @param k - parameter k of Exp. Golomb algorithm to be used - * (see comment on EXP_GOLOMB_K macro for details about k) + * sense that lowest allowed index (@n) starts with 1, not with zero. */ static VariLenAffix expGolombEncode(uint64_t n, int k) { @@ -677,7 +679,9 @@ static VariLenAffix expGolombEncode(uint64_t n, int k) } =20 /** - * @brief Converts a suffix into a prefix, or a prefix into a suffix. + * invertAffix() - Converts a suffix into a prefix, or a prefix into a suf= fix. + * @affix: either suffix or prefix to be inverted + * Return: inversion of passed @affix * * Simply mirror all bits of the affix value, for the purpose to preserve * respectively the mathematical "prefix-free" or "suffix-free" property @@ -701,16 +705,16 @@ static VariLenAffix invertAffix(const VariLenAffix *a= ffix) } =20 /** - * @brief Generates suffix numbers with "suffix-free" property. + * affixForIndex() - Generates suffix numbers with "suffix-free" property. + * @index: natural number (or index) of the suffix to be generated + * (1, 2, 3, ...) + * Return: Suffix suitable to assemble unique number. * * This is just a wrapper function on top of the Exp. Golomb algorithm. * * Since the Exp. Golomb algorithm generates prefixes, but we need suffixe= s, * this function converts the Exp. Golomb prefixes into appropriate suffix= es * which are still suitable for generating unique numbers. - * - * @param n - natural number (or index) of the suffix to be generated - * (1, 2, 3, ...) */ static VariLenAffix affixForIndex(uint64_t index) { @@ -810,8 +814,8 @@ static int qid_inode_prefix_hash_bits(V9fsPDU *pdu, dev= _t dev) return val->prefix_bits; } =20 -/** - * @brief Slow / full mapping host inode nr -> guest inode nr. +/* + * Slow / full mapping host inode nr -> guest inode nr. * * This function performs a slower and much more costly remapping of an * original file inode number on host to an appropriate different inode @@ -823,7 +827,7 @@ static int qid_inode_prefix_hash_bits(V9fsPDU *pdu, dev= _t dev) * qid_path_suffixmap() failed. In practice this slow / full mapping is not * expected ever to be used at all though. * - * @see qid_path_suffixmap() for details + * See qid_path_suffixmap() for details * */ static int qid_path_fullmap(V9fsPDU *pdu, const struct stat *stbuf, @@ -864,8 +868,8 @@ static int qid_path_fullmap(V9fsPDU *pdu, const struct = stat *stbuf, return 0; } =20 -/** - * @brief Quick mapping host inode nr -> guest inode nr. +/* + * Quick mapping host inode nr -> guest inode nr. * * This function performs quick remapping of an original file inode number * on host to an appropriate different inode number on guest. This remappi= ng @@ -1281,12 +1285,15 @@ static int coroutine_fn stat_to_v9stat(V9fsPDU *pdu= , V9fsPath *path, =20 =20 /** - * Convert host filesystem's block size into an appropriate block size for - * 9p client (guest OS side). The value returned suggests an "optimum" blo= ck - * size for 9p I/O, i.e. to maximize performance. + * blksize_to_iounit() - Block size exposed to 9p client. + * Return: block size * * @pdu: 9p client request * @blksize: host filesystem's block size + * + * Convert host filesystem's block size into an appropriate block size for + * 9p client (guest OS side). The value returned suggests an "optimum" blo= ck + * size for 9p I/O, i.e. to maximize performance. */ static int32_t blksize_to_iounit(const V9fsPDU *pdu, int32_t blksize) { @@ -2398,10 +2405,11 @@ out_nofid: } =20 /** - * Returns size required in Rreaddir response for the passed dirent @p nam= e. + * v9fs_readdir_response_size() - Returns size required in Rreaddir respon= se + * for the passed dirent @name. * - * @param name - directory entry's name (i.e. file name, directory name) - * @returns required size in bytes + * @name: directory entry's name (i.e. file name, directory name) + * Return: required size in bytes */ size_t v9fs_readdir_response_size(V9fsString *name) { --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646400443; cv=none; d=zohomail.com; s=zohoarc; b=bT57HTK/pZ4UfwOAIdeuqyDdLIkmC5DiZlpLeboA0UExuLcoxrlo4Lj+Mg1H7A2FdDDzb8RdTPlznsayb0Mf27eOCWvbZ46c7SFXFi2EI0k/5ClwvXJ9joOv4kQwWRva6TPJEUZMbgf1cT4pvnGF9OtgztSC/wJGyl7QhCXq66c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400443; 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=C0n5rb3uf8xpWdqiD2GEa2RdawEtGlxmub4/foc/Crk=; b=cZXppq9fPhBHPotZuSqOFd6bJLX1f41wyDZ5EGiKnS9C1WK9yp7SuZTMBorEX1uJUL9eaSGNPUGPevLcTOY06ur4bQGRGhia8q6+VQFcZoSDUzVqOdgHBZV9rh2fTROu5ORI6hapHL8hzAgmigXD5/LZjrFJBZqSyy8J3Usr+wU= 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 1646400443953289.2811661002969; Fri, 4 Mar 2022 05:27:23 -0800 (PST) Received: from localhost ([::1]:59622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7xq-0000ya-BD for importer@patchew.org; Fri, 04 Mar 2022 08:27:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7mx-0001BJ-BP for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:16:08 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:34941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7mv-0006Ek-AE for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:16:07 -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=C0n5rb3uf8xpWdqiD2GEa2RdawEtGlxmub4/foc/Crk=; b=W+eUz SJJQexphlmMVV1te2F3SYJYDTwbFymx/OJJ2gaXsOtPaz5Yiv/io+T1TLUmKalE5/AlVVD/ihC4KD QMIUOHF7RuE555rcQOOAMJv6Rp5QdDU8zps2BeW4BNfE66/8xlUk8oM8pVsI2gfHLlKCheVob+HNV QnxxsyG6K0BqVYlDGyJswdeurPkSDVEVR/SU60M227gNA91D06+Yg+HJx7NtSuXnAkUEZgl8Wf4io r7bjd69qJ6bkb1QurVWfMH1SPH9J3561KK8TaoezAN4EK1zlwoAaqFGFTxrOTp6D8w6cq1GbnvS9m 5ryooPBFtVy2HDQucFJkRHxxWv4sQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 17/19] 9pfs/9p-util.h: convert Doxygen -> kerneldoc format 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=c626a3151a004689918ab65a5ecdeea06755580c@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: 1646400446791100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so convert API doc comments from Doxygen format to kerneldoc format. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p-util.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index 22835c5f61..cfa7af43c5 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -97,7 +97,7 @@ ssize_t flistxattrat_nofollow(int dirfd, const char *file= name, ssize_t fremovexattrat_nofollow(int dirfd, const char *filename, const char *name); =20 -/** +/* * Darwin has d_seekoff, which appears to function similarly to d_off. * However, it does not appear to be supported on all file systems, * so ensure it is manually injected earlier and call here when @@ -113,15 +113,15 @@ static inline off_t qemu_dirent_off(struct dirent *de= nt) } =20 /** - * Duplicate directory entry @dent. + * qemu_dirent_dup() - Duplicate directory entry @dent. + * + * @dent: original directory entry to be duplicated + * Return: duplicated directory entry which should be freed with g_free() * * It is highly recommended to use this function instead of open coding * duplication of dirent objects, because the actual struct dirent * size may be bigger or shorter than sizeof(struct dirent) and correct * handling is platform specific (see gitlab issue #841). - * - * @dent - original directory entry to be duplicated - * @returns duplicated directory entry which should be freed with g_free() */ static inline struct dirent *qemu_dirent_dup(struct dirent *dent) { --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646401034; cv=none; d=zohomail.com; s=zohoarc; b=M4PgpzQ97ygM/ORB4lhVIiUBSN4hQAX5/mCvhXQleCasaIjn75YL7QWssoSUgY2ctpjH11YpDiKSI4HZU62aCqH9KYSd/KLIPDG/ZHE/bs2zViLuyeKkLo+W7AzT5RRkQJps8V50HR2bmYpfIhQauSP7/76AlU52+F6twis0ccc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646401034; 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=Dis0cFCt3Kt62wTSFGnP7lUDxDeSvq1HWoewP11CBIo=; b=SyG9H2HHaU6wmYG0CCqvGb0q1dnMP/VsErDDv5g3OigXGLrz3NDyOycIRzZcwgMQCmXRjBqWODLPnCGCNquRl2564msMpP2quv2YIo701sljmaiQBWzmPYS2dNAl6zfSPEcVuNmu8x6h7UliaaB+LIW81m3wC58tt0kkAHr/tsw= 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 164640103429461.06463038284869; Fri, 4 Mar 2022 05:37:14 -0800 (PST) Received: from localhost ([::1]:48606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ87N-0005C1-Af for importer@patchew.org; Fri, 04 Mar 2022 08:37:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7vN-0000Tj-66 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:24:49 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:43305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7vL-0006Ph-1q for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:24:48 -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=Dis0cFCt3Kt62wTSFGnP7lUDxDeSvq1HWoewP11CBIo=; b=pxbDG Z9Huvime/Q2QZQ7/zmneTe4QiiCoiPK1JWoMTYa0avXyzoHI8WqMDlFefeE5ujSeFGZ3i0bt6YFUX Rws2uqKbbaVh5UxPY9RjLdoz+gSXSAsNrF/sohEM4r8kIvDuuOJHx5MdpscNygIdsXBsmrctZOz5r JHeq621cl/bOyHxJ4m3SgRz3TM5BKN4cIh/gTlH+ybnYikVY9F/ByIg6ZjKYwMBFTyqg9gMRGVrHJ NbPAboEW4AWwpQ+nLore2QRpbkp0NrQ1WVTBNw3kVa93nyfKT7iSA26htoNWqf0ba9XFXhqtjcUIO 0bJQee5EoW/K7sqNT50EX5muKlmIQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 18/19] 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() 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=cb7d8fe9910c24655ac043065031cc8e4fe84720@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: 1646401035272100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so drop Doxygen format used on v9fs_co_run_in_worker() macro. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/coth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/coth.h b/hw/9pfs/coth.h index f83c7dda7b..1a1edbdc2a 100644 --- a/hw/9pfs/coth.h +++ b/hw/9pfs/coth.h @@ -19,7 +19,7 @@ #include "qemu/coroutine.h" #include "9p.h" =20 -/** +/* * we want to use bottom half because we want to make sure the below * sequence of events. * @@ -29,7 +29,7 @@ * we cannot swap step 1 and 2, because that would imply worker thread * can enter coroutine while step1 is still running * - * @b PERFORMANCE @b CONSIDERATIONS: As a rule of thumb, keep in mind + * PERFORMANCE CONSIDERATIONS: As a rule of thumb, keep in mind * that hopping between threads adds @b latency! So when handling a * 9pfs request, avoid calling v9fs_co_run_in_worker() too often, because * this might otherwise sum up to a significant, huge overall latency for --=20 2.20.1 From nobody Tue May 14 07:25:53 2024 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=1646400452; cv=none; d=zohomail.com; s=zohoarc; b=Kkp8giaTezl3mPf77cBRiKeAdK2pdei0zxD0YnJK8JDwKiq7MYUL068XZ9t0jJjF4tnPDbXhboebB54tTJm4oa3DWzeCf1taIIfX9/cCzoiGK7I4bphl+T8/8rl366CjDovXJk26Tr4XjPurePmkCUdZPGRB7T3vzEalHdRAVOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646400452; 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=b0kJJvQRJXiKQl93Iwsx0o6lTjxaRMH0jAe0PwTHfuQ=; b=HJTLeFzCbdU8BT+11VtoaaxKAgcsUaUjIpzeGMYegffmLCNZHR4oz/YNCYQbqpxc3kH4XDQ1GoL6dat1K96IePIpzsBJfCfdn7Zmeg2f2anruWJZ7VbPRs7hog41d6d/mYiSzoCE/TMgtp9NZlZfQtitgX+eIDzox4hY1YP+hHY= 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 1646400452111715.7182414575092; Fri, 4 Mar 2022 05:27:32 -0800 (PST) Received: from localhost ([::1]:60420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7xz-0001Wv-3h for importer@patchew.org; Fri, 04 Mar 2022 08:27:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <39edfe337c418995b2932a9a14a612fb0c329dc5@lizzy.crudebyte.com>) id 1nQ7ks-00089d-Jl for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:13:58 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:34675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <39edfe337c418995b2932a9a14a612fb0c329dc5@lizzy.crudebyte.com>) id 1nQ7kq-0005u1-FO for qemu-devel@nongnu.org; Fri, 04 Mar 2022 08:13:57 -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=b0kJJvQRJXiKQl93Iwsx0o6lTjxaRMH0jAe0PwTHfuQ=; b=WEUWO 6hS+lekJxEDvQh9XfmPNomVapKOAKgzfwtIeXaxkrnVfM8sl2qVLPLICW4/eLHQ9sTOPSodk6Q8QW Mk/MXVQRgJw7rw4WYPkceO+TfZ1VERxZf4kqz+ZASMR62WpigFgeCXafM91FRGocV6sMsIRwKU0Xm FtpHvNHUHm7Jwgy4QMCIbLv8/NEOnYW0YRHiFv9cXg96d1b+5p5Mho2KITmekBm6L+NDUsnXUNiyO s6li7lQr5ysung0DfmbqYZftS3Je0tPHIIJySZmtuAGP0MB3a1Thh2UWpq0V5dCNgd9NCLBZeJjzp vfYNWEy4CXmbUV/CzgHj2ii3kX5cg==; Message-Id: <39edfe337c418995b2932a9a14a612fb0c329dc5.1646396869.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 04 Mar 2022 13:27:49 +0100 Subject: [PULL 19/19] fsdev/p9array.h: convert Doxygen -> kerneldoc format 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=39edfe337c418995b2932a9a14a612fb0c329dc5@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: 1646400453567100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" API doc comments in QEMU are supposed to be in kerneldoc format, so convert API doc comments from Doxygen format to kerneldoc format. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <2e2d46a402560f155de322d95789ba107d728885.1646314856.git.qemu_o= ss@crudebyte.com> --- fsdev/p9array.h | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fsdev/p9array.h b/fsdev/p9array.h index 6aa25327ca..90e83a7c7b 100644 --- a/fsdev/p9array.h +++ b/fsdev/p9array.h @@ -81,11 +81,11 @@ */ =20 /** - * Declares an array type for the passed @a scalar_type. + * P9ARRAY_DECLARE_TYPE() - Declares an array type for the passed @scalar_= type. * - * This is typically used from a shared header file. + * @scalar_type: type of the individual array elements * - * @param scalar_type - type of the individual array elements + * This is typically used from a shared header file. */ #define P9ARRAY_DECLARE_TYPE(scalar_type) \ typedef struct P9Array##scalar_type { \ @@ -97,14 +97,14 @@ void p9array_auto_free_##scalar_type(scalar_type **auto_var); \ =20 /** - * Defines an array type for the passed @a scalar_type and appropriate - * @a scalar_cleanup_func. + * P9ARRAY_DEFINE_TYPE() - Defines an array type for the passed @scalar_ty= pe + * and appropriate @scalar_cleanup_func. * - * This is typically used from a C unit file. + * @scalar_type: type of the individual array elements + * @scalar_cleanup_func: appropriate function to free memory dynamically + * allocated by individual array elements before * - * @param scalar_type - type of the individual array elements - * @param scalar_cleanup_func - appropriate function to free memory dynami= cally - * allocated by individual array elements bef= ore + * This is typically used from a C unit file. */ #define P9ARRAY_DEFINE_TYPE(scalar_type, scalar_cleanup_func) \ void p9array_new_##scalar_type(scalar_type **auto_var, size_t len) \ @@ -132,23 +132,27 @@ } \ =20 /** + * P9ARRAY_REF() - Declare a reference variable for an array. + * + * @scalar_type: type of the individual array elements + * * Used to declare a reference variable (unique pointer) for an array. Aft= er * leaving the scope of the reference variable, the associated array is * automatically freed. - * - * @param scalar_type - type of the individual array elements */ #define P9ARRAY_REF(scalar_type) \ __attribute((__cleanup__(p9array_auto_free_##scalar_type))) scalar_typ= e* =20 /** - * Allocates a new array of passed @a scalar_type with @a len number of ar= ray - * elements and assigns the created array to the reference variable - * @a auto_var. + * P9ARRAY_NEW() - Allocate a new array. * - * @param scalar_type - type of the individual array elements - * @param auto_var - destination reference variable - * @param len - amount of array elements to be allocated immediately + * @scalar_type: type of the individual array elements + * @auto_var: destination reference variable + * @len: amount of array elements to be allocated immediately + * + * Allocates a new array of passed @scalar_type with @len number of array + * elements and assigns the created array to the reference variable + * @auto_var. */ #define P9ARRAY_NEW(scalar_type, auto_var, len) \ QEMU_BUILD_BUG_MSG( \ --=20 2.20.1