* [PULL 0/5] 9p queue 2022-12-23 @ 2022-12-23 11:04 Christian Schoenebeck 2022-12-23 11:04 ` [PULL 2/5] MAINTAINERS: Add 9p test client to section "virtio-9p" Christian Schoenebeck ` (5 more replies) 0 siblings, 6 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell Cc: Greg Kurz, Bin Meng, Markus Armbruster, Philippe Mathieu-Daudé, Wilfred Mallawa The following changes since commit 222059a0fccf4af3be776fe35a5ea2d6a68f9a0b: Merge tag 'pull-ppc-20221221' of https://gitlab.com/danielhb/qemu into staging (2022-12-21 18:08:09 +0000) are available in the Git repository at: https://github.com/cschoenebeck/qemu.git tags/pull-9p-20221223 for you to fetch changes up to 6ca60cd7a388a776d72739e5a404e65c19460511: hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper (2022-12-23 11:48:13 +0100) ---------------------------------------------------------------- 9pfs: Windows host prep, cleanup * Next preparatory patches for upcoming Windows host support. * Cleanup patches. ---------------------------------------------------------------- Bin Meng (3): qemu/xattr.h: Exclude <sys/xattr.h> for Windows hw/9pfs: Drop unnecessary *xattr wrapper API declarations hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper Christian Schoenebeck (1): MAINTAINERS: Add 9p test client to section "virtio-9p" Greg Kurz (1): 9pfs: Fix some return statements in the synth backend MAINTAINERS | 1 + hw/9pfs/9p-local.c | 32 ++++++++++++++++---------------- hw/9pfs/9p-synth.c | 12 ++++++------ hw/9pfs/9p-util.h | 26 +++++++++++--------------- include/qemu/xattr.h | 4 +++- 5 files changed, 37 insertions(+), 38 deletions(-) ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PULL 2/5] MAINTAINERS: Add 9p test client to section "virtio-9p" 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck @ 2022-12-23 11:04 ` Christian Schoenebeck 2022-12-23 11:04 ` [PULL 4/5] hw/9pfs: Drop unnecessary *xattr wrapper API declarations Christian Schoenebeck ` (4 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell Cc: Greg Kurz, Philippe Mathieu-Daudé, Wilfred Mallawa The 9p test cases use a dedicated, lite-weight 9p client implementation (using virtio transport) under tests/qtest/libqos/ to communicate with QEMU's 9p server. It's already there for a long time. Let's officially assign it to 9p maintainers. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com> Message-Id: <E1ozhlV-0007BU-0g@lizzy.crudebyte.com> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b270eb8e5b..b0091d2ad8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2053,6 +2053,7 @@ X: hw/9pfs/xen-9p* F: fsdev/ F: docs/tools/virtfs-proxy-helper.rst F: tests/qtest/virtio-9p-test.c +F: tests/qtest/libqos/virtio-9p* T: git https://gitlab.com/gkurz/qemu.git 9p-next T: git https://github.com/cschoenebeck/qemu.git 9p.next -- 2.30.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PULL 4/5] hw/9pfs: Drop unnecessary *xattr wrapper API declarations 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck 2022-12-23 11:04 ` [PULL 2/5] MAINTAINERS: Add 9p test client to section "virtio-9p" Christian Schoenebeck @ 2022-12-23 11:04 ` Christian Schoenebeck 2022-12-23 11:04 ` [PULL 3/5] qemu/xattr.h: Exclude <sys/xattr.h> for Windows Christian Schoenebeck ` (3 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Bin Meng From: Bin Meng <bin.meng@windriver.com> These are not used anywhere in the source tree. Drop them. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <20221219102022.2167736-3-bin.meng@windriver.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> --- hw/9pfs/9p-util.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index c3526144c9..ccfc8b1cb3 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -90,19 +90,8 @@ static inline int errno_to_dotl(int err) { #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) -- 2.30.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PULL 3/5] qemu/xattr.h: Exclude <sys/xattr.h> for Windows 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck 2022-12-23 11:04 ` [PULL 2/5] MAINTAINERS: Add 9p test client to section "virtio-9p" Christian Schoenebeck 2022-12-23 11:04 ` [PULL 4/5] hw/9pfs: Drop unnecessary *xattr wrapper API declarations Christian Schoenebeck @ 2022-12-23 11:04 ` Christian Schoenebeck 2022-12-23 11:04 ` [PULL 1/5] 9pfs: Fix some return statements in the synth backend Christian Schoenebeck ` (2 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Bin Meng From: Bin Meng <bin.meng@windriver.com> Windows does not have <sys/xattr.h>. Signed-off-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20221219102022.2167736-2-bin.meng@windriver.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> --- include/qemu/xattr.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h index f1d0f7be74..b08a934acc 100644 --- a/include/qemu/xattr.h +++ b/include/qemu/xattr.h @@ -25,7 +25,9 @@ # if !defined(ENOATTR) # define ENOATTR ENODATA # endif -# include <sys/xattr.h> +# ifndef CONFIG_WIN32 +# include <sys/xattr.h> +# endif #endif #endif -- 2.30.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PULL 1/5] 9pfs: Fix some return statements in the synth backend 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck ` (2 preceding siblings ...) 2022-12-23 11:04 ` [PULL 3/5] qemu/xattr.h: Exclude <sys/xattr.h> for Windows Christian Schoenebeck @ 2022-12-23 11:04 ` Christian Schoenebeck 2022-12-23 11:04 ` [PULL 5/5] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper Christian Schoenebeck 2023-01-04 16:47 ` [PULL 0/5] 9p queue 2022-12-23 Peter Maydell 5 siblings, 0 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Markus Armbruster From: Greg Kurz <groug@kaod.org> The qemu_v9fs_synth_mkdir() and qemu_v9fs_synth_add_file() functions currently return a positive errno value on failure. This causes checkpatch.pl to spit several errors like the one below: ERROR: return of an errno should typically be -ve (return -EAGAIN) + return EAGAIN; Simply change the sign. This has no consequence since callers assert() the returned value to be equal to 0. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <166930551818.827792.10663674346122681963.stgit@bahia> [C.S.: - Resolve conflict with 66997c42e02c. ] Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> --- hw/9pfs/9p-synth.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 38d787f494..f62c40b639 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -75,10 +75,10 @@ int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode, V9fsSynthNode *node, *tmp; if (!synth_fs) { - return EAGAIN; + return -EAGAIN; } if (!name || (strlen(name) >= NAME_MAX)) { - return EINVAL; + return -EINVAL; } if (!parent) { parent = &synth_root; @@ -86,7 +86,7 @@ int qemu_v9fs_synth_mkdir(V9fsSynthNode *parent, int mode, QEMU_LOCK_GUARD(&synth_mutex); QLIST_FOREACH(tmp, &parent->child, sibling) { if (!strcmp(tmp->name, name)) { - return EEXIST; + return -EEXIST; } } /* Add the name */ @@ -106,10 +106,10 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode, V9fsSynthNode *node, *tmp; if (!synth_fs) { - return EAGAIN; + return -EAGAIN; } if (!name || (strlen(name) >= NAME_MAX)) { - return EINVAL; + return -EINVAL; } if (!parent) { parent = &synth_root; @@ -118,7 +118,7 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode, QEMU_LOCK_GUARD(&synth_mutex); QLIST_FOREACH(tmp, &parent->child, sibling) { if (!strcmp(tmp->name, name)) { - return EEXIST; + return -EEXIST; } } /* Add file type and remove write bits */ -- 2.30.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PULL 5/5] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck ` (3 preceding siblings ...) 2022-12-23 11:04 ` [PULL 1/5] 9pfs: Fix some return statements in the synth backend Christian Schoenebeck @ 2022-12-23 11:04 ` Christian Schoenebeck 2023-01-04 16:47 ` [PULL 0/5] 9p queue 2022-12-23 Peter Maydell 5 siblings, 0 replies; 7+ messages in thread From: Christian Schoenebeck @ 2022-12-23 11:04 UTC (permalink / raw) To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Bin Meng From: Bin Meng <bin.meng@windriver.com> xxxat() APIs are only available on POSIX platforms. For future extension to Windows, let's replace the direct call to xxxat() APIs with a wrapper. Signed-off-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20221219102022.2167736-4-bin.meng@windriver.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> --- hw/9pfs/9p-local.c | 32 ++++++++++++++++---------------- hw/9pfs/9p-util.h | 15 +++++++++++---- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index d42ce6d8b8..d2246a3d7e 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -103,14 +103,14 @@ static void renameat_preserve_errno(int odirfd, const char *opath, int ndirfd, const char *npath) { int serrno = errno; - renameat(odirfd, opath, ndirfd, npath); + qemu_renameat(odirfd, opath, ndirfd, npath); errno = serrno; } static void unlinkat_preserve_errno(int dirfd, const char *path, int flags) { int serrno = errno; - unlinkat(dirfd, path, flags); + qemu_unlinkat(dirfd, path, flags); errno = serrno; } @@ -194,7 +194,7 @@ static int local_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf) goto out; } - err = fstatat(dirfd, name, stbuf, AT_SYMLINK_NOFOLLOW); + err = qemu_fstatat(dirfd, name, stbuf, AT_SYMLINK_NOFOLLOW); if (err) { goto err_out; } @@ -253,7 +253,7 @@ static int local_set_mapped_file_attrat(int dirfd, const char *name, } } } else { - ret = mkdirat(dirfd, VIRTFS_META_DIR, 0700); + ret = qemu_mkdirat(dirfd, VIRTFS_META_DIR, 0700); if (ret < 0 && errno != EEXIST) { return -1; } @@ -349,7 +349,7 @@ static int fchmodat_nofollow(int dirfd, const char *name, mode_t mode) */ /* First, we clear non-racing symlinks out of the way. */ - if (fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW)) { + if (qemu_fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW)) { return -1; } if (S_ISLNK(stbuf.st_mode)) { @@ -734,7 +734,7 @@ static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, if (fs_ctx->export_flags & V9FS_SM_MAPPED || fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) { - err = mkdirat(dirfd, name, fs_ctx->dmode); + err = qemu_mkdirat(dirfd, name, fs_ctx->dmode); if (err == -1) { goto out; } @@ -750,7 +750,7 @@ static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, } } else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH || fs_ctx->export_flags & V9FS_SM_NONE) { - err = mkdirat(dirfd, name, credp->fc_mode); + err = qemu_mkdirat(dirfd, name, credp->fc_mode); if (err == -1) { goto out; } @@ -990,7 +990,7 @@ static int local_link(FsContext *ctx, V9fsPath *oldpath, if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { int omap_dirfd, nmap_dirfd; - ret = mkdirat(ndirfd, VIRTFS_META_DIR, 0700); + ret = qemu_mkdirat(ndirfd, VIRTFS_META_DIR, 0700); if (ret < 0 && errno != EEXIST) { goto err_undo_link; } @@ -1085,7 +1085,7 @@ static int local_utimensat(FsContext *s, V9fsPath *fs_path, goto out; } - ret = utimensat(dirfd, name, buf, AT_SYMLINK_NOFOLLOW); + ret = qemu_utimensat(dirfd, name, buf, AT_SYMLINK_NOFOLLOW); close_preserve_errno(dirfd); out: g_free(dirpath); @@ -1116,7 +1116,7 @@ static int local_unlinkat_common(FsContext *ctx, int dirfd, const char *name, if (fd == -1) { return -1; } - ret = unlinkat(fd, VIRTFS_META_DIR, AT_REMOVEDIR); + ret = qemu_unlinkat(fd, VIRTFS_META_DIR, AT_REMOVEDIR); close_preserve_errno(fd); if (ret < 0 && errno != ENOENT) { return -1; @@ -1124,7 +1124,7 @@ static int local_unlinkat_common(FsContext *ctx, int dirfd, const char *name, } map_dirfd = openat_dir(dirfd, VIRTFS_META_DIR); if (map_dirfd != -1) { - ret = unlinkat(map_dirfd, name, 0); + ret = qemu_unlinkat(map_dirfd, name, 0); close_preserve_errno(map_dirfd); if (ret < 0 && errno != ENOENT) { return -1; @@ -1134,7 +1134,7 @@ static int local_unlinkat_common(FsContext *ctx, int dirfd, const char *name, } } - return unlinkat(dirfd, name, flags); + return qemu_unlinkat(dirfd, name, flags); } static int local_remove(FsContext *ctx, const char *path) @@ -1151,7 +1151,7 @@ static int local_remove(FsContext *ctx, const char *path) goto out; } - if (fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { + if (qemu_fstatat(dirfd, name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { goto err_out; } @@ -1296,7 +1296,7 @@ static int local_renameat(FsContext *ctx, V9fsPath *olddir, return -1; } - ret = renameat(odirfd, old_name, ndirfd, new_name); + ret = qemu_renameat(odirfd, old_name, ndirfd, new_name); if (ret < 0) { goto out; } @@ -1304,7 +1304,7 @@ static int local_renameat(FsContext *ctx, V9fsPath *olddir, if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { int omap_dirfd, nmap_dirfd; - ret = mkdirat(ndirfd, VIRTFS_META_DIR, 0700); + ret = qemu_mkdirat(ndirfd, VIRTFS_META_DIR, 0700); if (ret < 0 && errno != EEXIST) { goto err_undo_rename; } @@ -1321,7 +1321,7 @@ static int local_renameat(FsContext *ctx, V9fsPath *olddir, } /* rename the .virtfs_metadata files */ - ret = renameat(omap_dirfd, old_name, nmap_dirfd, new_name); + ret = qemu_renameat(omap_dirfd, old_name, nmap_dirfd, new_name); close_preserve_errno(nmap_dirfd); close_preserve_errno(omap_dirfd); if (ret < 0 && errno != ENOENT) { diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h index ccfc8b1cb3..c314cf381d 100644 --- a/hw/9pfs/9p-util.h +++ b/hw/9pfs/9p-util.h @@ -94,6 +94,13 @@ static inline int errno_to_dotl(int err) { #define qemu_fgetxattr fgetxattr #endif +#define qemu_openat openat +#define qemu_fstatat fstatat +#define qemu_mkdirat mkdirat +#define qemu_renameat renameat +#define qemu_utimensat utimensat +#define qemu_unlinkat unlinkat + static inline void close_preserve_errno(int fd) { int serrno = errno; @@ -103,8 +110,8 @@ static inline void close_preserve_errno(int fd) static inline int openat_dir(int dirfd, const char *name) { - return openat(dirfd, name, - O_DIRECTORY | O_RDONLY | O_NOFOLLOW | O_PATH_9P_UTIL); + return qemu_openat(dirfd, name, + O_DIRECTORY | O_RDONLY | O_NOFOLLOW | O_PATH_9P_UTIL); } static inline int openat_file(int dirfd, const char *name, int flags, @@ -115,8 +122,8 @@ static inline int openat_file(int dirfd, const char *name, int flags, #ifndef CONFIG_DARWIN again: #endif - fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK, - mode); + fd = qemu_openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK, + mode); if (fd == -1) { #ifndef CONFIG_DARWIN if (errno == EPERM && (flags & O_NOATIME)) { -- 2.30.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PULL 0/5] 9p queue 2022-12-23 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck ` (4 preceding siblings ...) 2022-12-23 11:04 ` [PULL 5/5] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper Christian Schoenebeck @ 2023-01-04 16:47 ` Peter Maydell 5 siblings, 0 replies; 7+ messages in thread From: Peter Maydell @ 2023-01-04 16:47 UTC (permalink / raw) To: Christian Schoenebeck Cc: qemu-devel, Greg Kurz, Bin Meng, Markus Armbruster, Philippe Mathieu-Daudé, Wilfred Mallawa On Fri, 23 Dec 2022 at 11:12, Christian Schoenebeck <qemu_oss@crudebyte.com> wrote: > > The following changes since commit 222059a0fccf4af3be776fe35a5ea2d6a68f9a0b: > > Merge tag 'pull-ppc-20221221' of https://gitlab.com/danielhb/qemu into staging (2022-12-21 18:08:09 +0000) > > are available in the Git repository at: > > https://github.com/cschoenebeck/qemu.git tags/pull-9p-20221223 > > for you to fetch changes up to 6ca60cd7a388a776d72739e5a404e65c19460511: > > hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper (2022-12-23 11:48:13 +0100) > > ---------------------------------------------------------------- > 9pfs: Windows host prep, cleanup > > * Next preparatory patches for upcoming Windows host support. > > * Cleanup patches. > Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0 for any user-visible changes. -- PMM ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-01-04 16:48 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-12-23 11:04 [PULL 0/5] 9p queue 2022-12-23 Christian Schoenebeck 2022-12-23 11:04 ` [PULL 2/5] MAINTAINERS: Add 9p test client to section "virtio-9p" Christian Schoenebeck 2022-12-23 11:04 ` [PULL 4/5] hw/9pfs: Drop unnecessary *xattr wrapper API declarations Christian Schoenebeck 2022-12-23 11:04 ` [PULL 3/5] qemu/xattr.h: Exclude <sys/xattr.h> for Windows Christian Schoenebeck 2022-12-23 11:04 ` [PULL 1/5] 9pfs: Fix some return statements in the synth backend Christian Schoenebeck 2022-12-23 11:04 ` [PULL 5/5] hw/9pfs: Replace the direct call to xxxat() APIs with a wrapper Christian Schoenebeck 2023-01-04 16:47 ` [PULL 0/5] 9p queue 2022-12-23 Peter Maydell
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).