qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 13/19] 9pfs: drop Doxygen format from qemu_dirent_dup() API comment
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (7 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 10/19] 9p: darwin: Adjust assumption on virtio-9p-test Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 02/19] 9p: Rename 9p-util -> 9p-util-linux Christian Schoenebeck
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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+ENOM6x19OEF53Kd2DWkhN5SN21Va0D7yepJSa3Jyg@mail.gmail.com/
Based-on: <E1nP9Oz-00043L-KJ@lizzy.crudebyte.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <E1nPTwO-0006pl-Np@lizzy.crudebyte.com>
---
 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
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 07/19] 9p: darwin: *xattr_nofollow implementations
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (4 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 17/19] 9pfs/9p-util.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 15/19] 9pfs/codir.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-8-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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 later.
+ * 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 = openat_file(dirfd, filename,
+                         O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0);
+    if (fd == -1) {
+        return -1;
+    }
+    ret = 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 = openat_file(dirfd, filename,
+                         O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0);
+    if (fd == -1) {
+        return -1;
+    }
+    ret = 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 = openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0);
+    if (fd == -1) {
+        return -1;
+    }
+    ret = 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 = openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0);
+    if (fd == -1) {
+        return -1;
+    }
+    ret = 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)
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 15/19] 9pfs/codir.c: convert Doxygen -> kerneldoc format
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (5 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 07/19] 9p: darwin: *xattr_nofollow implementations Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 10/19] 9p: darwin: Adjust assumption on virtio-9p-test Christian Schoenebeck
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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 <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <c76be7d38ea448c6417b2ffb5ccd6b711519a878.1646314856.git.qemu_oss@crudebyte.com>
---
 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:
 }
 
 /**
- * @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 half).
  * Internally this function call will be dispatched to a background IO thread
  * (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 calling
+ * 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,
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 01/19] 9p: linux: Fix a couple Linux assumptions
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (15 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 04/19] 9p: darwin: Handle struct dirent differences Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 14/19] 9pfs/9p.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

 - 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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>

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 <wwcohen@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220227223522.91937-2-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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 @@
 
 #include <dirent.h>
 #include <utime.h>
-#include <sys/vfs.h>
 #include "qemu-fsdev-throttle.h"
 #include "p9array.h"
 
+#ifdef CONFIG_LINUX
+# include <sys/vfs.h>
+#endif
+#ifdef CONFIG_DARWIN
+# include <sys/param.h>
+# include <sys/mount.h>
+#endif
+
 #define SM_LOCAL_MODE_BITS    0600
 #define SM_LOCAL_DIR_MODE_BITS    0700
 
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 <libgen.h>
+#ifdef CONFIG_LINUX
 #include <linux/fs.h>
 #ifdef CONFIG_LINUX_MAGIC_H
 #include <linux/magic.h>
 #endif
+#endif
 #include <sys/ioctl.h>
 
 #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 <math.h>
+#ifdef CONFIG_LINUX
 #include <linux/limits.h>
+#else
+#include <limits.h>
+#endif
 
 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 <attr/xattr.h>
 #else
-#  define ENOATTR ENODATA
+#  if !defined(ENOATTR)
+#    define ENOATTR ENODATA
+#  endif
 #  include <sys/xattr.h>
 #endif
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 17/19] 9pfs/9p-util.h: convert Doxygen -> kerneldoc format
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (3 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 06/19] 9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 07/19] 9p: darwin: *xattr_nofollow implementations Christian Schoenebeck
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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 <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <dc1c4a85e233f5884ee5f6ec96b87db286083df7.1646314856.git.qemu_oss@crudebyte.com>
---
 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 *filename,
 ssize_t fremovexattrat_nofollow(int dirfd, const char *filename,
                                 const char *name);
 
-/**
+/*
  * 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 *dent)
 }
 
 /**
- * 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)
 {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 19/19] fsdev/p9array.h: convert Doxygen -> kerneldoc format
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (17 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 14/19] 9pfs/9p.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 18:42 ` [PULL 00/19] 9p queue 2022-03-04 Peter Maydell
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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 <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <2e2d46a402560f155de322d95789ba107d728885.1646314856.git.qemu_oss@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 @@
  */
 
 /**
- * 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); \
 
 /**
- * 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_type
+ * 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 dynamically
- *                              allocated by individual array elements before
+ * 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 @@
     } \
 
 /**
+ * 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. After
  * 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_type*
 
 /**
- * Allocates a new array of passed @a scalar_type with @a len number of array
- * 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( \
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 16/19] 9pfs/9p.c: convert Doxygen -> kerneldoc format
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (13 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 18/19] 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 04/19] 9p: darwin: Handle struct dirent differences Christian Schoenebeck
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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 <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <4ece6ffa4465c271c6a7c42a3040f42780fcce87.1646314856.git.qemu_oss@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));
 }
 
-/**
- * @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=0 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 would
  * cause completely different inode numbers to be generated on guest.
  */
 #define EXP_GOLOMB_K    0
 
 /**
- * @brief Exponential Golomb algorithm for arbitrary k (including k=0).
+ * expGolombEncode() - Exponential Golomb algorithm for arbitrary k
+ *                     (including k=0).
  *
- * 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)
 }
 
 /**
- * @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 suffix.
+ * @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 *affix)
 }
 
 /**
- * @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 suffixes,
  * this function converts the Exp. Golomb prefixes into appropriate suffixes
  * 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;
 }
 
-/**
- * @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;
 }
 
-/**
- * @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 remapping
@@ -1281,12 +1285,15 @@ static int coroutine_fn stat_to_v9stat(V9fsPDU *pdu, V9fsPath *path,
 
 
 /**
- * Convert host filesystem's block size into an appropriate block size for
- * 9p client (guest OS side). The value returned suggests an "optimum" block
- * 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" block
+ * 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:
 }
 
 /**
- * Returns size required in Rreaddir response for the passed dirent @p name.
+ * v9fs_readdir_response_size() - Returns size required in Rreaddir response
+ * 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)
 {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 11/19] 9p: darwin: meson: Allow VirtFS on Darwin
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (10 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 12/19] 9pfs: move qemu_dirent_dup() from osdep -> 9p-util Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 09/19] 9p: darwin: Implement compatibility for mknodat Christian Schoenebeck
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
[Will Cohen: - Rebase to master]
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
[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 <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-12-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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)
 
 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 = get_option('dbus_display') \
   .allowed()
 
 have_virtfs = get_option('virtfs') \
-    .require(targetos == 'linux',
-             error_message: 'virtio-9p (virtfs) requires Linux') \
-    .require(libattr.found() and libcap_ng.found(),
-             error_message: 'virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel') \
+    .require(targetos == 'linux' or targetos == 'darwin',
+             error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
+    .require(targetos == 'linux' or cc.has_function('pthread_fchdir_np'),
+             error_message: 'virtio-9p (virtfs) on macOS requires the presence of pthread_fchdir_np') \
+    .require(targetos == 'darwin' or (libattr.found() and libcap_ng.found()),
+             error_message: 'virtio-9p (virtfs) on Linux requires libcap-ng-devel and libattr-devel') \
     .disable_auto_if(not have_tools and not have_system) \
     .allowed()
 
-have_virtfs_proxy_helper = have_virtfs and have_tools
+have_virtfs_proxy_helper = targetos != 'darwin' and have_virtfs and have_tools
 
 foreach k : get_option('trace_backends')
   config_host_data.set('CONFIG_TRACE_' + k.to_upper(), true)
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 08/19] 9p: darwin: Compatibility for f/l*xattr
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT} Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 03/19] 9p: darwin: Handle struct stat(fs) differences Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 06/19] 9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX Christian Schoenebeck
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-9-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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_type,
         mode_t tmp_mode;
         dev_t tmp_dev;
 
-        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 = 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 = 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 = 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 = 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
 
+#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 = errno;
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 18/19] 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker()
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (12 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 09/19] 9p: darwin: Implement compatibility for mknodat Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 16/19] 9pfs/9p.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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 <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <a8fdf0290d1e40a68f5577f29aeae12298b70733.1646314856.git.qemu_oss@crudebyte.com>
---
 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"
 
-/**
+/*
  * 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
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 04/19] 9p: darwin: Handle struct dirent differences
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (14 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 16/19] 9pfs/9p.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 01/19] 9p: linux: Fix a couple Linux assumptions Christian Schoenebeck
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
[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 <fabianfranz.oss@gmail.com>
[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 <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-5-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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 = telldir(fs->dir.stream);
+    /* If telldir fails, fail the entire readdir call */
+    if (off < 0) {
+        return NULL;
+    }
+    entry->d_seekoff = off;
+#endif
 
     if (ctx->export_flags & V9FS_SM_MAPPED) {
         entry->d_type = 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, V9fsFidOpenState *fs)
 
 static struct dirent *proxy_readdir(FsContext *ctx, V9fsFidOpenState *fs)
 {
-    return readdir(fs->dir.stream);
+    struct dirent *entry;
+    entry = readdir(fs->dir.stream);
+#ifdef CONFIG_DARWIN
+    if (!entry) {
+        return NULL;
+    }
+    int td;
+    td = telldir(fs->dir.stream);
+    /* If telldir fails, fail the entire readdir call */
+    if (td < 0) {
+        return NULL;
+    }
+    entry->d_seekoff = td;
+#endif
+    return entry;
 }
 
 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 = node->attr->inode;
+#ifdef CONFIG_DARWIN
+    entry->d_seekoff = off + 1;
+#else
     entry->d_off = off + 1;
+#endif
 }
 
 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 *filename,
 ssize_t fremovexattrat_nofollow(int dirfd, const char *filename,
                                 const char *name);
 
+/**
+ * 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(V9fsPDU *pdu,
         count += len;
         v9fs_stat_free(&v9stat);
         v9fs_path_free(&path);
-        saved_dir_pos = dent->d_off;
+        saved_dir_pos = qemu_dirent_off(dent);
     }
 
     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 = 0;
     int32_t count = 0;
+    off_t off;
     struct dirent *dent;
     struct stat *st;
     struct V9fsDirEnt *entries = NULL;
@@ -2480,12 +2482,13 @@ static int coroutine_fn v9fs_do_readdir(V9fsPDU *pdu, V9fsFidState *fidp,
             qid.version = 0;
         }
 
+        off = qemu_dirent_off(dent);
         v9fs_string_init(&name);
         v9fs_string_sprintf(&name, "%s", dent->d_name);
 
         /* 11 = 7 + 4 (7 = start offset, 4 = space for storing count) */
         len = pdu_marshal(pdu, 11 + count, "Qqbs",
-                          &qid, dent->d_off,
+                          &qid, off,
                           dent->d_type, &name);
 
         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"
 
 /*
  * 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,
         }
 
         size += len;
-        saved_dir_pos = dent->d_off;
+        saved_dir_pos = qemu_dirent_off(dent);
     }
 
     /* restore (last) saved position */
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 09/19] 9p: darwin: Implement compatibility for mknodat
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (11 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 11/19] 9p: darwin: meson: Allow VirtFS on Darwin Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 18/19] 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() Christian Schoenebeck
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
[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 <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-10-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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,
 
     if (fs_ctx->export_flags & V9FS_SM_MAPPED ||
         fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) {
-        err = mknodat(dirfd, name, fs_ctx->fmode | S_IFREG, 0);
+        err = qemu_mknodat(dirfd, name, fs_ctx->fmode | S_IFREG, 0);
         if (err == -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 = mknodat(dirfd, name, credp->fc_mode, credp->fc_rdev);
+        err = qemu_mknodat(dirfd, name, credp->fc_mode, credp->fc_rdev);
         if (err == -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 @@
 
 #include "qemu/osdep.h"
 #include "qemu/xattr.h"
+#include "qapi/error.h"
+#include "qemu/error-report.h"
 #include "9p-util.h"
 
 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 version of macOS");
+        return -ENOTSUP;
+    }
+    if (pthread_fchdir_np(dirfd) < 0) {
+        return -1;
+    }
+    err = mknod(filename, mode, dev);
+    preserved_errno = errno;
+    /* Stop using the thread-local cwd */
+    pthread_fchdir_np(-1);
+    if (err < 0) {
+        errno = 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 = 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 *dent)
 #endif
 }
 
+/*
+ * 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);
 
 #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_memalign'))
 config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll'))
 config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include <sys/uio.h>'))
+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_timedwait', 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_function('unshare'))
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 00/19] 9p queue 2022-03-04
@ 2022-03-04 12:27 Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT} Christian Schoenebeck
                   ` (19 more replies)
  0 siblings, 20 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

The following changes since commit 5959ef7d431ffd02db112209cf55e47b677256fd:

  Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging (2022-03-03 19:59:38 +0000)

are available in the Git repository at:

  https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304

for you to fetch changes up to 39edfe337c418995b2932a9a14a612fb0c329dc5:

  fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04 13:07:39 +0100)

----------------------------------------------------------------
9pfs: introduce macOS host support and cleanup

* Add support for Darwin (a.k.a. macOS) hosts.

* Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).

* API doc cleanup (convert Doxygen -> kerneldoc format).

----------------------------------------------------------------
Christian Schoenebeck (8):
      9pfs: move qemu_dirent_dup() from osdep -> 9p-util
      9pfs: drop Doxygen format from qemu_dirent_dup() API comment
      9pfs/9p.h: convert Doxygen -> kerneldoc format
      9pfs/codir.c: convert Doxygen -> kerneldoc format
      9pfs/9p.c: convert Doxygen -> kerneldoc format
      9pfs/9p-util.h: convert Doxygen -> kerneldoc format
      9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker()
      fsdev/p9array.h: convert Doxygen -> kerneldoc format

Keno Fischer (10):
      9p: linux: Fix a couple Linux assumptions
      9p: Rename 9p-util -> 9p-util-linux
      9p: darwin: Handle struct stat(fs) differences
      9p: darwin: Handle struct dirent differences
      9p: darwin: Ignore O_{NOATIME, DIRECT}
      9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX
      9p: darwin: *xattr_nofollow implementations
      9p: darwin: Compatibility for f/l*xattr
      9p: darwin: Implement compatibility for mknodat
      9p: darwin: meson: Allow VirtFS on Darwin

Will Cohen (1):
      9p: darwin: Adjust assumption on virtio-9p-test

 fsdev/file-op-9p.h                     |   9 ++-
 fsdev/meson.build                      |   1 +
 fsdev/p9array.h                        |  38 ++++++------
 hw/9pfs/9p-local.c                     |  27 +++++++--
 hw/9pfs/9p-proxy.c                     |  38 +++++++++++-
 hw/9pfs/9p-synth.c                     |   6 ++
 hw/9pfs/9p-util-darwin.c               |  97 ++++++++++++++++++++++++++++++
 hw/9pfs/{9p-util.c => 9p-util-linux.c} |   8 ++-
 hw/9pfs/9p-util.h                      |  76 ++++++++++++++++++++++++
 hw/9pfs/9p.c                           | 104 ++++++++++++++++++++++-----------
 hw/9pfs/9p.h                           |  30 ++++++++--
 hw/9pfs/codir.c                        |  34 ++++++-----
 hw/9pfs/coth.h                         |   4 +-
 hw/9pfs/meson.build                    |   3 +-
 include/qemu/osdep.h                   |  13 -----
 include/qemu/xattr.h                   |   4 +-
 meson.build                            |  13 +++--
 tests/qtest/virtio-9p-test.c           |   2 +-
 util/osdep.c                           |  21 -------
 19 files changed, 401 insertions(+), 127 deletions(-)
 create mode 100644 hw/9pfs/9p-util-darwin.c
 rename hw/9pfs/{9p-util.c => 9p-util-linux.c} (90%)


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PULL 02/19] 9p: Rename 9p-util -> 9p-util-linux
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (8 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 13/19] 9pfs: drop Doxygen format from qemu_dirent_dup() API comment Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 12/19] 9pfs: move qemu_dirent_dup() from osdep -> 9p-util Christian Schoenebeck
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220227223522.91937-3-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 hw/9pfs/{9p-util.c => 9p-util-linux.c} | 2 +-
 hw/9pfs/meson.build                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename hw/9pfs/{9p-util.c => 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)
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 14/19] 9pfs/9p.h: convert Doxygen -> kerneldoc format
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (16 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 01/19] 9p: linux: Fix a couple Linux assumptions Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 19/19] fsdev/p9array.h: " Christian Schoenebeck
  2022-03-04 18:42 ` [PULL 00/19] 9p queue 2022-03-04 Peter Maydell
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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: <E1nPTwO-0006pl-Np@lizzy.crudebyte.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <2b8f91de7bac3d3bc85d60eb08830a35a394be75.1646314856.git.qemu_oss@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 = 0x02,
 } P9ProtoVersion;
 
-/**
- * @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 proto_version, V9fsDir *dir)
     }
 }
 
-/**
+/*
  * 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;
 
-/**
- * @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 value
+     * Lenght of the affix, that is how many (of the lowest) bits of ``value``
      * must be used for appending/prepending this affix to its final resulting,
      * unique number.
      */
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT}
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 03/19] 9p: darwin: Handle struct stat(fs) differences Christian Schoenebeck
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

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 <keno@juliacomputing.com>
[Michael Roitzsch: - Rebase for NixOS]
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
[Will Cohen: - Adjust coding style]
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-6-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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 = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
                 mode);
     if (fd == -1) {
+#ifndef CONFIG_DARWIN
         if (errno == EPERM && (flags & O_NOATIME)) {
             /*
              * The client passed O_NOATIME but we lack permissions to honor it.
@@ -53,6 +54,7 @@ again:
             flags &= ~O_NOATIME;
             goto again;
         }
+#endif
         return -1;
     }
 
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 },
     };
 
@@ -171,10 +180,12 @@ static int get_dotl_openflags(V9fsState *s, int oflags)
      */
     flags = dotl_to_open_flags(oflags);
     flags &= ~(O_NOCTTY | O_ASYNC | O_CREAT);
+#ifndef CONFIG_DARWIN
     /*
      * Ignore direct disk access hint until the server supports it.
      */
     flags &= ~O_DIRECT;
+#endif
     return flags;
 }
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 10/19] 9p: darwin: Adjust assumption on virtio-9p-test
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (6 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 15/19] 9pfs/codir.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 13/19] 9pfs: drop Doxygen format from qemu_dirent_dup() API comment Christian Schoenebeck
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Will Cohen <wwcohen@gmail.com>

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 == id): (7 == 77) Bail out!

ERROR:../tests/qtest/virtio-9p-test.c:305:v9fs_req_recv: assertion
failed (hdr.id == id): (7 == 77)

Signed-off-by: Fabian Franz <fabianfranz.oss@gmail.com>
[Will Cohen: - Add explanation of patch and description
               of pre-patch test failure]
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Acked-by: Thomas Huth <thuth@redhat.com>
[Will Cohen: - Move this patch before 9p: darwin: meson
               patch to avoid qtest breakage during
               bisecting]
Signed-off-by: Will Cohen <wwcohen@gmail.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220227223522.91937-11-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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, QGuestAllocator *t_alloc)
     /* ... and is actually a directory */
     g_assert((st.st_mode & S_IFMT) == S_IFDIR);
 
-    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) != 0);
 }
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 12/19] 9pfs: move qemu_dirent_dup() from osdep -> 9p-util
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (9 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 02/19] 9p: Rename 9p-util -> 9p-util-linux Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 11/19] 9p: darwin: meson: Allow VirtFS on Darwin Christian Schoenebeck
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

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_=HAUNomKD2wurSVaAHa5mrk22A1oHKLWUDjk7v6Khmg@mail.gmail.com/
Based-on: <20220227223522.91937-12-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <E1nP9Oz-00043L-KJ@lizzy.crudebyte.com>
---
 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 *dent)
 #endif
 }
 
+/**
+ * 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 = 0;
+#if defined _DIRENT_HAVE_D_RECLEN
+    /* Avoid use of strlen() if platform supports d_reclen. */
+    sz = 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 == 0) {
+        /* Fallback to the most portable way. */
+        sz = 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(const char *command)
 }
 #endif /* !HAVE_SYSTEM_FUNCTION */
 
-/**
- * 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
 
-#include <dirent.h>
 #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 = 0;
-#if defined _DIRENT_HAVE_D_RECLEN
-    /* Avoid use of strlen() if platform supports d_reclen. */
-    sz = 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 == 0) {
-        /* Fallback to the most portable way. */
-        sz = offsetof(struct dirent, d_name) +
-                      strlen(dent->d_name) + 1;
-    }
-    return g_memdup(dent, sz);
-}
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 06/19] 9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (2 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 08/19] 9p: darwin: Compatibility for f/l*xattr Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 17/19] 9pfs/9p-util.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>

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 <wwcohen@gmail.com>
Signed-off-by: Fabian Franz <fabianfranz.oss@gmail.com>
[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 <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-7-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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 *opaque)
         rflags |= XATTR_REPLACE;
     }
 
-    if (size > XATTR_SIZE_MAX) {
+    if (size > P9_XATTR_SIZE_MAX) {
         err = -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);
 };
 
+#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 limit of
+ * Linux guests.
+ */
+#define P9_XATTR_SIZE_MAX 65536
+#else
+#error Missing definition for P9_XATTR_SIZE_MAX for this host system
+#endif
+
 #endif
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PULL 03/19] 9p: darwin: Handle struct stat(fs) differences
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT} Christian Schoenebeck
@ 2022-03-04 12:27 ` Christian Schoenebeck
  2022-03-04 12:27 ` [PULL 08/19] 9p: darwin: Compatibility for f/l*xattr Christian Schoenebeck
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 12:27 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Greg Kurz

From: Keno Fischer <keno@juliacomputing.com>

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Michael Roitzsch <reactorcontrol@icloud.com>
[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 <wwcohen@gmail.com>
Message-Id: <20220227223522.91937-4-wwcohen@gmail.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 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, ProxyStatFS *prstfs)
     stfs->f_bavail = prstfs->f_bavail;
     stfs->f_files = prstfs->f_files;
     stfs->f_ffree = prstfs->f_ffree;
+#ifdef CONFIG_DARWIN
+    /* f_namelen and f_frsize do not exist on Darwin */
+    stfs->f_fsid.val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;
+    stfs->f_fsid.val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;
+#else
     stfs->f_fsid.__val[0] = prstfs->f_fsid[0] & 0xFFFFFFFFU;
     stfs->f_fsid.__val[1] = prstfs->f_fsid[1] >> 32 & 0xFFFFFFFFU;
     stfs->f_namelen = prstfs->f_namelen;
     stfs->f_frsize = prstfs->f_frsize;
+#endif
 }
 
 /* Converts proxy_stat structure to VFS stat structure */
@@ -143,12 +149,24 @@ static void prstat_to_stat(struct stat *stbuf, ProxyStat *prstat)
    stbuf->st_size = prstat->st_size;
    stbuf->st_blksize = prstat->st_blksize;
    stbuf->st_blocks = prstat->st_blocks;
+   stbuf->st_atime = prstat->st_atim_sec;
+   stbuf->st_mtime = prstat->st_mtim_sec;
+   stbuf->st_ctime = prstat->st_ctim_sec;
+#ifdef CONFIG_DARWIN
+   stbuf->st_atimespec.tv_sec = prstat->st_atim_sec;
+   stbuf->st_mtimespec.tv_sec = prstat->st_mtim_sec;
+   stbuf->st_ctimespec.tv_sec = prstat->st_ctim_sec;
+   stbuf->st_atimespec.tv_nsec = prstat->st_atim_nsec;
+   stbuf->st_mtimespec.tv_nsec = prstat->st_mtim_nsec;
+   stbuf->st_ctimespec.tv_nsec = prstat->st_ctim_nsec;
+#else
    stbuf->st_atim.tv_sec = prstat->st_atim_sec;
+   stbuf->st_mtim.tv_sec = prstat->st_mtim_sec;
+   stbuf->st_ctim.tv_sec = prstat->st_ctim_sec;
    stbuf->st_atim.tv_nsec = prstat->st_atim_nsec;
-   stbuf->st_mtime = prstat->st_mtim_sec;
    stbuf->st_mtim.tv_nsec = prstat->st_mtim_nsec;
-   stbuf->st_ctime = prstat->st_ctim_sec;
    stbuf->st_ctim.tv_nsec = prstat->st_ctim_nsec;
+#endif
 }
 
 /*
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 = 512;
     stbuf->f_blocks = 0;
     stbuf->f_files = synth_node_count;
+#ifndef CONFIG_DARWIN
     stbuf->f_namelen = NAME_MAX;
+#endif
     return 0;
 }
 
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 = stat_to_iounit(pdu, stbuf);
     v9lstat->st_blocks = stbuf->st_blocks;
     v9lstat->st_atime_sec = stbuf->st_atime;
-    v9lstat->st_atime_nsec = stbuf->st_atim.tv_nsec;
     v9lstat->st_mtime_sec = stbuf->st_mtime;
-    v9lstat->st_mtime_nsec = stbuf->st_mtim.tv_nsec;
     v9lstat->st_ctime_sec = stbuf->st_ctime;
+#ifdef CONFIG_DARWIN
+    v9lstat->st_atime_nsec = stbuf->st_atimespec.tv_nsec;
+    v9lstat->st_mtime_nsec = stbuf->st_mtimespec.tv_nsec;
+    v9lstat->st_ctime_nsec = stbuf->st_ctimespec.tv_nsec;
+#else
+    v9lstat->st_atime_nsec = stbuf->st_atim.tv_nsec;
+    v9lstat->st_mtime_nsec = stbuf->st_mtim.tv_nsec;
     v9lstat->st_ctime_nsec = stbuf->st_ctim.tv_nsec;
+#endif
     /* Currently we only support BASIC fields in stat */
     v9lstat->st_result_mask = P9_STATS_BASIC;
 
@@ -3519,9 +3525,15 @@ static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
     f_bavail = stbuf->f_bavail / bsize_factor;
     f_files  = stbuf->f_files;
     f_ffree  = stbuf->f_ffree;
+#ifdef CONFIG_DARWIN
+    fsid_val = (unsigned int)stbuf->f_fsid.val[0] |
+               (unsigned long long)stbuf->f_fsid.val[1] << 32;
+    f_namelen = NAME_MAX;
+#else
     fsid_val = (unsigned int) stbuf->f_fsid.__val[0] |
                (unsigned long long)stbuf->f_fsid.__val[1] << 32;
     f_namelen = stbuf->f_namelen;
+#endif
 
     return pdu_marshal(pdu, offset, "ddqqqqqqd",
                        f_type, f_bsize, f_blocks, f_bfree,
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
                   ` (18 preceding siblings ...)
  2022-03-04 12:27 ` [PULL 19/19] fsdev/p9array.h: " Christian Schoenebeck
@ 2022-03-04 18:42 ` Peter Maydell
  2022-03-04 20:16   ` Christian Schoenebeck
  19 siblings, 1 reply; 26+ messages in thread
From: Peter Maydell @ 2022-03-04 18:42 UTC (permalink / raw)
  To: Christian Schoenebeck; +Cc: qemu-devel, Greg Kurz

On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> The following changes since commit 5959ef7d431ffd02db112209cf55e47b677256fd:
>
>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging (2022-03-03 19:59:38 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
>
> for you to fetch changes up to 39edfe337c418995b2932a9a14a612fb0c329dc5:
>
>   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04 13:07:39 +0100)
>
> ----------------------------------------------------------------
> 9pfs: introduce macOS host support and cleanup
>
> * Add support for Darwin (a.k.a. macOS) hosts.
>
> * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
>
> * API doc cleanup (convert Doxygen -> kerneldoc format).


This fails to build on my OSX box:

In file included from ../../hw/9pfs/9p-util-darwin.c:12:
../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
[-Werror,-Wunused-label]
again:
^~~~~~

because the use of the label is inside a #ifndef CONFIG_DARWIN
but the definition is not.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-04 18:42 ` [PULL 00/19] 9p queue 2022-03-04 Peter Maydell
@ 2022-03-04 20:16   ` Christian Schoenebeck
  2022-03-04 21:31     ` Will Cohen
  0 siblings, 1 reply; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-04 20:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Greg Kurz, Will Cohen, Keno Fischer

On Freitag, 4. März 2022 19:42:18 CET Peter Maydell wrote:
> On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
> 
> <qemu_oss@crudebyte.com> wrote:
> > The following changes since commit 
5959ef7d431ffd02db112209cf55e47b677256fd:
> >   Merge remote-tracking branch
> >   'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging
> >   (2022-03-03 19:59:38 +0000)> 
> > are available in the Git repository at:
> >   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
> > 
> > for you to fetch changes up to 39edfe337c418995b2932a9a14a612fb0c329dc5:
> >   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04
> >   13:07:39 +0100)> 
> > ----------------------------------------------------------------
> > 9pfs: introduce macOS host support and cleanup
> > 
> > * Add support for Darwin (a.k.a. macOS) hosts.
> > 
> > * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
> > 
> > * API doc cleanup (convert Doxygen -> kerneldoc format).
> 
> This fails to build on my OSX box:
> 
> In file included from ../../hw/9pfs/9p-util-darwin.c:12:
> ../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
> [-Werror,-Wunused-label]
> again:
> ^~~~~~
> 
> because the use of the label is inside a #ifndef CONFIG_DARWIN
> but the definition is not.
> 
> thanks
> -- PMM

So basically it needs this change:

diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
index cfa7af43c5..97e681e167 100644
--- a/hw/9pfs/9p-util.h
+++ b/hw/9pfs/9p-util.h
@@ -54,7 +54,9 @@ static inline int openat_file(int dirfd, const char *name, 
int flags,
 {
     int fd, serrno, ret;
 
+#ifndef CONFIG_DARWIN
 again:
+#endif
     fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
                 mode);
     if (fd == -1) {

Will, can you check why this did not fail there and whether there are probably 
more issues?

If that's the only one, let me know, then I would fix this on my end and 
resend a PR ASAP. Thanks!

Best regards,
Christian Schoenebeck




^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-04 20:16   ` Christian Schoenebeck
@ 2022-03-04 21:31     ` Will Cohen
  2022-03-06 20:59       ` Will Cohen
  2022-03-07 10:05       ` Greg Kurz
  0 siblings, 2 replies; 26+ messages in thread
From: Will Cohen @ 2022-03-04 21:31 UTC (permalink / raw)
  To: Christian Schoenebeck; +Cc: Peter Maydell, Keno Fischer, Greg Kurz, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

On Fri, Mar 4, 2022 at 3:16 PM Christian Schoenebeck <qemu_oss@crudebyte.com>
wrote:

> On Freitag, 4. März 2022 19:42:18 CET Peter Maydell wrote:
> > On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
> >
> > <qemu_oss@crudebyte.com> wrote:
> > > The following changes since commit
> 5959ef7d431ffd02db112209cf55e47b677256fd:
> > >   Merge remote-tracking branch
> > >   'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging
> > >   (2022-03-03 19:59:38 +0000)>
> > > are available in the Git repository at:
> > >   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
> > >
> > > for you to fetch changes up to
> 39edfe337c418995b2932a9a14a612fb0c329dc5:
> > >   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04
> > >   13:07:39 +0100)>
> > > ----------------------------------------------------------------
> > > 9pfs: introduce macOS host support and cleanup
> > >
> > > * Add support for Darwin (a.k.a. macOS) hosts.
> > >
> > > * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
> > >
> > > * API doc cleanup (convert Doxygen -> kerneldoc format).
> >
> > This fails to build on my OSX box:
> >
> > In file included from ../../hw/9pfs/9p-util-darwin.c:12:
> > ../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
> > [-Werror,-Wunused-label]
> > again:
> > ^~~~~~
> >
> > because the use of the label is inside a #ifndef CONFIG_DARWIN
> > but the definition is not.
> >
> > thanks
> > -- PMM
>
> So basically it needs this change:
>
> diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
> index cfa7af43c5..97e681e167 100644
> --- a/hw/9pfs/9p-util.h
> +++ b/hw/9pfs/9p-util.h
> @@ -54,7 +54,9 @@ static inline int openat_file(int dirfd, const char
> *name,
> int flags,
>  {
>      int fd, serrno, ret;
>
> +#ifndef CONFIG_DARWIN
>  again:
> +#endif
>      fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
>                  mode);
>      if (fd == -1) {
>
> Will, can you check why this did not fail there and whether there are
> probably
> more issues?
>
> If that's the only one, let me know, then I would fix this on my end and
> resend a PR ASAP. Thanks!


These were just warnings for me so I didn’t worry about them. Will check
where else it appears when building!


>
> Best regards,
> Christian Schoenebeck
>
>
>

[-- Attachment #2: Type: text/html, Size: 3438 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-04 21:31     ` Will Cohen
@ 2022-03-06 20:59       ` Will Cohen
  2022-03-07  9:47         ` Christian Schoenebeck
  2022-03-07 10:05       ` Greg Kurz
  1 sibling, 1 reply; 26+ messages in thread
From: Will Cohen @ 2022-03-06 20:59 UTC (permalink / raw)
  To: Christian Schoenebeck
  Cc: Peter Maydell, Keno Fischer, Greg Kurz, qemu Developers

[-- Attachment #1: Type: text/plain, Size: 3955 bytes --]

On Fri, Mar 4, 2022 at 4:31 PM Will Cohen <wwcohen@gmail.com> wrote:

> On Fri, Mar 4, 2022 at 3:16 PM Christian Schoenebeck <
> qemu_oss@crudebyte.com> wrote:
>
>> On Freitag, 4. März 2022 19:42:18 CET Peter Maydell wrote:
>> > On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
>> >
>> > <qemu_oss@crudebyte.com> wrote:
>> > > The following changes since commit
>> 5959ef7d431ffd02db112209cf55e47b677256fd:
>> > >   Merge remote-tracking branch
>> > >   'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging
>> > >   (2022-03-03 19:59:38 +0000)>
>> > > are available in the Git repository at:
>> > >   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
>> > >
>> > > for you to fetch changes up to
>> 39edfe337c418995b2932a9a14a612fb0c329dc5:
>> > >   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04
>> > >   13:07:39 +0100)>
>> > > ----------------------------------------------------------------
>> > > 9pfs: introduce macOS host support and cleanup
>> > >
>> > > * Add support for Darwin (a.k.a. macOS) hosts.
>> > >
>> > > * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
>> > >
>> > > * API doc cleanup (convert Doxygen -> kerneldoc format).
>> >
>> > This fails to build on my OSX box:
>> >
>> > In file included from ../../hw/9pfs/9p-util-darwin.c:12:
>> > ../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
>> > [-Werror,-Wunused-label]
>> > again:
>> > ^~~~~~
>> >
>> > because the use of the label is inside a #ifndef CONFIG_DARWIN
>> > but the definition is not.
>> >
>> > thanks
>> > -- PMM
>>
>> So basically it needs this change:
>>
>> diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
>> index cfa7af43c5..97e681e167 100644
>> --- a/hw/9pfs/9p-util.h
>> +++ b/hw/9pfs/9p-util.h
>> @@ -54,7 +54,9 @@ static inline int openat_file(int dirfd, const char
>> *name,
>> int flags,
>>  {
>>      int fd, serrno, ret;
>>
>> +#ifndef CONFIG_DARWIN
>>  again:
>> +#endif
>>      fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
>>                  mode);
>>      if (fd == -1) {
>>
>> Will, can you check why this did not fail there and whether there are
>> probably
>> more issues?
>>
>> If that's the only one, let me know, then I would fix this on my end and
>> resend a PR ASAP. Thanks!
>
>
> These were just warnings for me so I didn’t worry about them. Will check
> where else it appears when building!
>

When building using 9p.next, here's the full extent of warnings I see. It
appears it's just that one again at 9p-util.h:57.

In file included from ../hw/9pfs/9p-xattr.c:23:
../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
again:
^~~~~~
1 warning generated.
[3690/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-synth.c.o
[3691/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-local.c.o
In file included from ../hw/9pfs/9p-local.c:22:
../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
again:
^~~~~~
1 warning generated.
[3692/6798] Compiling C object libcommon.fa.p/hw_9pfs_codir.c.o
In file included from ../hw/9pfs/codir.c:26:
../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
again:
^~~~~~
1 warning generated.
[3693/6798] Compiling C object libcommon.fa.p/hw_9pfs_coth.c.o
[3694/6798] Compiling C object libcommon.fa.p/hw_9pfs_cofile.c.o
[3695/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-proxy.c.o
[3696/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-util-darwin.c.o
In file included from ../hw/9pfs/9p-util-darwin.c:12:
../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
again:
^~~~~~
1 warning generated.
In file included from ../hw/9pfs/9p.c:30:
../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
again:
^~~~~~
1 warning generated.


>
>>
>> Best regards,
>> Christian Schoenebeck
>>
>>
>>

[-- Attachment #2: Type: text/html, Size: 5461 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-06 20:59       ` Will Cohen
@ 2022-03-07  9:47         ` Christian Schoenebeck
  0 siblings, 0 replies; 26+ messages in thread
From: Christian Schoenebeck @ 2022-03-07  9:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Will Cohen, Peter Maydell, Keno Fischer, Greg Kurz

On Sonntag, 6. März 2022 21:59:55 CET Will Cohen wrote:
> On Fri, Mar 4, 2022 at 4:31 PM Will Cohen <wwcohen@gmail.com> wrote:
> > On Fri, Mar 4, 2022 at 3:16 PM Christian Schoenebeck <
> > 
> > qemu_oss@crudebyte.com> wrote:
> >> On Freitag, 4. März 2022 19:42:18 CET Peter Maydell wrote:
> >> > On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
> >> > 
> >> > <qemu_oss@crudebyte.com> wrote:
> >> > > The following changes since commit
> >> 
> >> 5959ef7d431ffd02db112209cf55e47b677256fd:
> >> > >   Merge remote-tracking branch
> >> > >   'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging
> >> > >   (2022-03-03 19:59:38 +0000)>
> >> > > 
> >> > > are available in the Git repository at:
> >> > >   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
> >> > > 
> >> > > for you to fetch changes up to
> >> 
> >> 39edfe337c418995b2932a9a14a612fb0c329dc5:
> >> > >   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04
> >> > >   13:07:39 +0100)>
> >> > > 
> >> > > ----------------------------------------------------------------
> >> > > 9pfs: introduce macOS host support and cleanup
> >> > > 
> >> > > * Add support for Darwin (a.k.a. macOS) hosts.
> >> > > 
> >> > > * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
> >> > > 
> >> > > * API doc cleanup (convert Doxygen -> kerneldoc format).
> >> > 
> >> > This fails to build on my OSX box:
> >> > 
> >> > In file included from ../../hw/9pfs/9p-util-darwin.c:12:
> >> > ../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
> >> > [-Werror,-Wunused-label]
> >> > again:
> >> > ^~~~~~
> >> > 
> >> > because the use of the label is inside a #ifndef CONFIG_DARWIN
> >> > but the definition is not.
> >> > 
> >> > thanks
> >> > -- PMM
> >> 
> >> So basically it needs this change:
> >> 
> >> diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
> >> index cfa7af43c5..97e681e167 100644
> >> --- a/hw/9pfs/9p-util.h
> >> +++ b/hw/9pfs/9p-util.h
> >> @@ -54,7 +54,9 @@ static inline int openat_file(int dirfd, const char
> >> *name,
> >> int flags,
> >> 
> >>  {
> >>  
> >>      int fd, serrno, ret;
> >> 
> >> +#ifndef CONFIG_DARWIN
> >> 
> >>  again:
> >> +#endif
> >> 
> >>      fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
> >>      
> >>                  mode);
> >>      
> >>      if (fd == -1) {
> >> 
> >> Will, can you check why this did not fail there and whether there are
> >> probably
> >> more issues?
> >> 
> >> If that's the only one, let me know, then I would fix this on my end and
> >> resend a PR ASAP. Thanks!
> > 
> > These were just warnings for me so I didn’t worry about them. Will check
> > where else it appears when building!
> 
> When building using 9p.next, here's the full extent of warnings I see. It
> appears it's just that one again at 9p-util.h:57.
> 
> In file included from ../hw/9pfs/9p-xattr.c:23:
> ../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
> again:
> ^~~~~~
> 1 warning generated.
> [3690/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-synth.c.o
> [3691/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-local.c.o
> In file included from ../hw/9pfs/9p-local.c:22:
> ../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
> again:
> ^~~~~~
> 1 warning generated.
> [3692/6798] Compiling C object libcommon.fa.p/hw_9pfs_codir.c.o
> In file included from ../hw/9pfs/codir.c:26:
> ../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
> again:
> ^~~~~~
> 1 warning generated.
> [3693/6798] Compiling C object libcommon.fa.p/hw_9pfs_coth.c.o
> [3694/6798] Compiling C object libcommon.fa.p/hw_9pfs_cofile.c.o
> [3695/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-proxy.c.o
> [3696/6798] Compiling C object libcommon.fa.p/hw_9pfs_9p-util-darwin.c.o
> In file included from ../hw/9pfs/9p-util-darwin.c:12:
> ../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
> again:
> ^~~~~~
> 1 warning generated.
> In file included from ../hw/9pfs/9p.c:30:
> ../hw/9pfs/9p-util.h:57:1: warning: unused label 'again' [-Wunused-label]
> again:
> ^~~~~~
> 1 warning generated.

OK, I'll fix this (single) issue on my end then exactly as suggested by me, 
and I'll send a new PR today. Thanks!

Best regards,
Christian Schoenebeck




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL 00/19] 9p queue 2022-03-04
  2022-03-04 21:31     ` Will Cohen
  2022-03-06 20:59       ` Will Cohen
@ 2022-03-07 10:05       ` Greg Kurz
  1 sibling, 0 replies; 26+ messages in thread
From: Greg Kurz @ 2022-03-07 10:05 UTC (permalink / raw)
  To: Will Cohen; +Cc: Peter Maydell, Keno Fischer, Christian Schoenebeck, qemu-devel

On Fri, 4 Mar 2022 16:31:07 -0500
Will Cohen <wwcohen@gmail.com> wrote:

> On Fri, Mar 4, 2022 at 3:16 PM Christian Schoenebeck <qemu_oss@crudebyte.com>
> wrote:
> 
> > On Freitag, 4. März 2022 19:42:18 CET Peter Maydell wrote:
> > > On Fri, 4 Mar 2022 at 12:32, Christian Schoenebeck
> > >
> > > <qemu_oss@crudebyte.com> wrote:
> > > > The following changes since commit
> > 5959ef7d431ffd02db112209cf55e47b677256fd:
> > > >   Merge remote-tracking branch
> > > >   'remotes/alistair/tags/pull-riscv-to-apply-20220303' into staging
> > > >   (2022-03-03 19:59:38 +0000)>
> > > > are available in the Git repository at:
> > > >   https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220304
> > > >
> > > > for you to fetch changes up to
> > 39edfe337c418995b2932a9a14a612fb0c329dc5:
> > > >   fsdev/p9array.h: convert Doxygen -> kerneldoc format (2022-03-04
> > > >   13:07:39 +0100)>
> > > > ----------------------------------------------------------------
> > > > 9pfs: introduce macOS host support and cleanup
> > > >
> > > > * Add support for Darwin (a.k.a. macOS) hosts.
> > > >
> > > > * Code cleanup (move qemu_dirent_dup() from osdep -> 9p-util).
> > > >
> > > > * API doc cleanup (convert Doxygen -> kerneldoc format).
> > >
> > > This fails to build on my OSX box:
> > >
> > > In file included from ../../hw/9pfs/9p-util-darwin.c:12:
> > > ../../hw/9pfs/9p-util.h:57:1: error: unused label 'again'
> > > [-Werror,-Wunused-label]
> > > again:
> > > ^~~~~~
> > >
> > > because the use of the label is inside a #ifndef CONFIG_DARWIN
> > > but the definition is not.
> > >
> > > thanks
> > > -- PMM
> >
> > So basically it needs this change:
> >
> > diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
> > index cfa7af43c5..97e681e167 100644
> > --- a/hw/9pfs/9p-util.h
> > +++ b/hw/9pfs/9p-util.h
> > @@ -54,7 +54,9 @@ static inline int openat_file(int dirfd, const char
> > *name,
> > int flags,
> >  {
> >      int fd, serrno, ret;
> >
> > +#ifndef CONFIG_DARWIN
> >  again:
> > +#endif
> >      fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
> >                  mode);
> >      if (fd == -1) {
> >
> > Will, can you check why this did not fail there and whether there are
> > probably
> > more issues?
> >
> > If that's the only one, let me know, then I would fix this on my end and
> > resend a PR ASAP. Thanks!
> 
> 
> These were just warnings for me so I didn’t worry about them. Will check
> where else it appears when building!
> 

Compiler warnings are frowned upon in the QEMU community since they
likely point to something that isn't right in your code. As you
might see, Peter's build has -Werror set and so have the builds
in the gitlab CI. Please consider passing --enable-werror to
configure, at least when you're about to post to the list.

> 
> >
> > Best regards,
> > Christian Schoenebeck
> >
> >
> >



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-03-07 11:07 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-04 12:27 [PULL 00/19] 9p queue 2022-03-04 Christian Schoenebeck
2022-03-04 12:27 ` [PULL 05/19] 9p: darwin: Ignore O_{NOATIME, DIRECT} Christian Schoenebeck
2022-03-04 12:27 ` [PULL 03/19] 9p: darwin: Handle struct stat(fs) differences Christian Schoenebeck
2022-03-04 12:27 ` [PULL 08/19] 9p: darwin: Compatibility for f/l*xattr Christian Schoenebeck
2022-03-04 12:27 ` [PULL 06/19] 9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX Christian Schoenebeck
2022-03-04 12:27 ` [PULL 17/19] 9pfs/9p-util.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
2022-03-04 12:27 ` [PULL 07/19] 9p: darwin: *xattr_nofollow implementations Christian Schoenebeck
2022-03-04 12:27 ` [PULL 15/19] 9pfs/codir.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
2022-03-04 12:27 ` [PULL 10/19] 9p: darwin: Adjust assumption on virtio-9p-test Christian Schoenebeck
2022-03-04 12:27 ` [PULL 13/19] 9pfs: drop Doxygen format from qemu_dirent_dup() API comment Christian Schoenebeck
2022-03-04 12:27 ` [PULL 02/19] 9p: Rename 9p-util -> 9p-util-linux Christian Schoenebeck
2022-03-04 12:27 ` [PULL 12/19] 9pfs: move qemu_dirent_dup() from osdep -> 9p-util Christian Schoenebeck
2022-03-04 12:27 ` [PULL 11/19] 9p: darwin: meson: Allow VirtFS on Darwin Christian Schoenebeck
2022-03-04 12:27 ` [PULL 09/19] 9p: darwin: Implement compatibility for mknodat Christian Schoenebeck
2022-03-04 12:27 ` [PULL 18/19] 9pfs/coth.h: drop Doxygen format on v9fs_co_run_in_worker() Christian Schoenebeck
2022-03-04 12:27 ` [PULL 16/19] 9pfs/9p.c: convert Doxygen -> kerneldoc format Christian Schoenebeck
2022-03-04 12:27 ` [PULL 04/19] 9p: darwin: Handle struct dirent differences Christian Schoenebeck
2022-03-04 12:27 ` [PULL 01/19] 9p: linux: Fix a couple Linux assumptions Christian Schoenebeck
2022-03-04 12:27 ` [PULL 14/19] 9pfs/9p.h: convert Doxygen -> kerneldoc format Christian Schoenebeck
2022-03-04 12:27 ` [PULL 19/19] fsdev/p9array.h: " Christian Schoenebeck
2022-03-04 18:42 ` [PULL 00/19] 9p queue 2022-03-04 Peter Maydell
2022-03-04 20:16   ` Christian Schoenebeck
2022-03-04 21:31     ` Will Cohen
2022-03-06 20:59       ` Will Cohen
2022-03-07  9:47         ` Christian Schoenebeck
2022-03-07 10:05       ` Greg Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).