Re: [Qemu-devel] [PATCH 07/19] aspeed: add support for multiple NICs

2019-05-25 Thread Keno Fischer
Drive by comment, since I spotted this in my inbox. When I tried to make this change (two years ago though), I additionally needed the following. Unfortunately, I don't quite remember exactly what the issue was, but I think qemu would crash trying to create more than one nic. ---

[Qemu-devel] [PATCH v3 11/13] 9p: darwin: Implement compatibility for mknodat

2018-06-16 Thread Keno Fischer
there is a solution: Darwin as an (unexposed in the C library) system call that sets the cwd for the current thread only. This should suffice to use mknod safely. Signed-off-by: Keno Fischer --- Changes since v2: - Silence clang warning for deprecated uses of `syscall`. It is unforunate that we have to use

[Qemu-devel] [PATCH v3 12/13] 9p: darwin: virtfs-proxy: Implement setuid code for darwin

2018-06-16 Thread Keno Fischer
. I had originally done this when I thought it made sense to have only one `setugid` function, but I retained this because it seems clearer this way. Signed-off-by: Keno Fischer --- fsdev/virtfs-proxy-helper.c | 200 +++- 1 file changed, 125 insertions

[Qemu-devel] [PATCH v3 13/13] 9p: darwin: configure: Allow VirtFS on Darwin

2018-06-16 Thread Keno Fischer
Signed-off-by: Keno Fischer --- Makefile.objs | 1 + configure | 22 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 7a9828d..c968a9a 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -104,6 +104,7 @@ common-obj

[Qemu-devel] [PATCH v3 04/13] 9p: darwin: Handle struct dirent differences

2018-06-16 Thread Keno Fischer
On darwin d_seekoff exists, but is optional and does not seem to be commonly used by file systems. Use `telldir` instead to obtain the seek offset. Signed-off-by: Keno Fischer --- hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c | 36 2 files changed, 34

[Qemu-devel] [PATCH v3 10/13] 9p: darwin: Provide a fallback implementation for utimensat

2018-06-16 Thread Keno Fischer
other than Apple clang that may not support this builtin. Signed-off-by: Keno Fischer --- fsdev/virtfs-proxy-helper.c | 3 +- hw/9pfs/9p-local.c | 2 +- hw/9pfs/9p-util-darwin.c| 96 + hw/9pfs/9p-util-linux.c | 6 +++ hw/9pfs/9p

[Qemu-devel] [PATCH v3 08/13] 9p: darwin: *xattr_nofollow implementations

2018-06-16 Thread Keno Fischer
This implements the darwin equivalent of the functions that were moved to 9p-util(-linux) earlier in this series in the new 9p-util-darwin file. Signed-off-by: Keno Fischer --- hw/9pfs/9p-util-darwin.c | 64 hw/9pfs/Makefile.objs| 1 + 2

[Qemu-devel] [PATCH v3 09/13] 9p: darwin: Compatibility for f/l*xattr

2018-06-16 Thread Keno Fischer
On darwin `fgetxattr` takes two extra optional arguments, and the l* variants are not defined (in favor of an extra flag to the regular variants. Signed-off-by: Keno Fischer --- Makefile| 6 ++ fsdev/virtfs-proxy-helper.c | 9 + hw/9pfs/9p-local.c | 12

[Qemu-devel] [PATCH v3 02/13] 9p: Rename 9p-util -> 9p-util-linux

2018-06-16 Thread Keno Fischer
The current file only has the Linux versions of these functions. Rename the file accordingly and update the Makefile to only build it on Linux. A Darwin version of these will follow later in the series. Signed-off-by: Keno Fischer --- hw/9pfs/9p-util-linux.c | 59

[Qemu-devel] [PATCH v3 05/13] 9p: darwin: Explicitly cast comparisons of mode_t with -1

2018-06-16 Thread Keno Fischer
Comparisons of mode_t with -1 require an explicit cast, since mode_t is unsigned on Darwin. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index d713983..98d4073 100644 --- a/hw

[Qemu-devel] [PATCH v3 01/13] 9p: linux: Fix a couple Linux assumptions

2018-06-16 Thread Keno Fischer
From: Keno Fischer - Guard Linux only headers. - Add qemu/statfs.h header to abstract over the which headers are needed for struct statfs - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno Fischer --- fsdev/file-op-9p.h

[Qemu-devel] [PATCH v3 00/13] 9p: Add support for Darwin

2018-06-16 Thread Keno Fischer
. Keno Keno Fischer (13): 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: Explicitly cast comparisons of mode_t with -1 9p: darwin: Ignore O_{NOATIME, DIR

[Qemu-devel] [PATCH v3 07/13] 9p: darwin: Provide a compatibility definition for XATTR_SIZE_MAX

2018-06-16 Thread Keno Fischer
Signed-off-by: Keno Fischer --- hw/9pfs/9p.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index e650459..abfb8dc 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3374,6 +3374,13 @@ out_nofid: v9fs_string_free(); } +#if defined(CONFIG_DARWIN

[Qemu-devel] [PATCH v3 03/13] 9p: darwin: Handle struct stat(fs) differences

2018-06-16 Thread Keno Fischer
Signed-off-by: Keno Fischer --- fsdev/virtfs-proxy-helper.c | 14 +++--- hw/9pfs/9p-proxy.c | 17 ++--- hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c| 16 ++-- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/fsdev

[Qemu-devel] [PATCH v3 06/13] 9p: darwin: Ignore O_{NOATIME, DIRECT}

2018-06-16 Thread Keno Fischer
Darwin doesn't have either of these flags. Darwin does have F_NOCACHE, which is similar to O_DIRECT, but has different enough semantics that other projects don't generally map them automatically. In any case, we don't support O_DIRECT on Linux at the moment either. Signed-off-by: Keno Fischer

[Qemu-devel] [PATCH] ui: darwin: gtk: Add missing input keymap

2018-06-13 Thread Keno Fischer
In appears the input keymap for osx was forgotten in the commit that converted the gtk frontend to keycodemapdb. Add it. Fixes: 2ec78706 ("ui: convert GTK and SDL1 frontends to keycodemapdb") CC: Daniel P. Berrange Signed-off-by: Keno Fischer --- Makefile | 1 + include/

[Qemu-devel] [PATCH v5] cutils: Provide strchrnul

2018-06-12 Thread Keno Fischer
the replacement pattern in a place where strchrnul could be used. Signed-off-by: Keno Fischer Acked-by: Greg Kurz --- Changes since v4: - `CONFIG_STRCHRNUL` -> `HAVE_STRCHRNUL` name change - In the strchrnul configure check - Return the value of strchrnul to avoid it being optimized away -

Re: [Qemu-devel] [PATCH v4] cutils: Provide strchrnul

2018-06-11 Thread Keno Fischer
> Suggest return strchrnul("Hello World", 'W') != 6, to avoid worries > about a sufficiently smart compilers optimizing out a call that would > otherwise fail to link, say because headers don't match libraries. I'm happy to do that, but then again, a sufficiently smart compiler might constant

[Qemu-devel] [PATCH v4] cutils: Provide strchrnul

2018-06-10 Thread Keno Fischer
the replacement pattern in a place where strchrnul could be used. Signed-off-by: Keno Fischer Acked-by: Greg Kurz --- Changes since v3: - Fix bug in configure check configure | 15 +++ hmp.c | 8 hw/9pfs/9p-local.c| 2 +- include/qemu/cutils.h | 8

[Qemu-devel] [PATCH v3 1/5] cutils: Provide strchrnul

2018-06-02 Thread Keno Fischer
the replacement pattern in a place where strchrnul could be used. Signed-off-by: Keno Fischer Acked-by: Greg Kurz --- Changes since v2: * Add configure check as suggested by Greg Kurz , and requested by Eric Blake * Use qemu_strchrnul in hmp_sendkey as suggested by Dr. David Alan Gilbert

[Qemu-devel] [PATCH v3 5/5] 9p: xattr: Properly translate xattrcreate flags

2018-06-02 Thread Keno Fischer
As with unlinkat, these flags come from the client and need to be translated to their host values. The protocol values happen to match linux, but that need not be true in general. Signed-off-by: Keno Fischer --- Changes since v2: New patch hw/9pfs/9p.c | 17 +++-- hw/9pfs/9p.h

[Qemu-devel] [PATCH v3 4/5] 9p: Properly check/translate flags in unlinkat

2018-06-02 Thread Keno Fischer
the translation code to the generic 9p server code and add an error if unrecognized flags are passed. Signed-off-by: Keno Fischer --- Changes since v2: * Remove 9p-handle code that did the same translation and is now incorrect. hw/9pfs/9p-handle.c | 8 +--- hw/9pfs/9p.c| 13 +++-- 2

[Qemu-devel] [PATCH v3 3/5] 9p: local: Avoid warning if FS_IOC_GETVERSION is not defined

2018-06-02 Thread Keno Fischer
Both `stbuf` and `local_ioc_getversion` where unused when FS_IOC_GETVERSION was not defined, causing a compiler warning. Reorganize the code to avoid this warning. Signed-off-by: Keno Fischer --- hw/9pfs/9p-local.c | 40 +++- 1 file changed, 23 insertions

[Qemu-devel] [PATCH v3 2/5] 9p: xattr: Fix crashes due to free of uninitialized value

2018-06-02 Thread Keno Fischer
, which is safe to pass to g_free. Signed-off-by: Keno Fischer --- Changes since v2: * Fix another instance of the problematic pattern later in the same function. hw/9pfs/9p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index d74302d

[Qemu-devel] [PATCH v3 0/5] Prepratory cleanup for 9p darwin support

2018-06-02 Thread Keno Fischer
Hi Greg, this is a respin of just the first couple of patches of my 9p Darwin series. These patches should be applicable independent of the darwin work. Keno Fischer (5): cutils: Provide strchrnul 9p: xattr: Fix crashes due to free of uninitialized value 9p: local: Avoid warning

Re: [Qemu-devel] [PATCH v2 15/20] 9p: darwin: *xattr_nofollow implementations

2018-06-02 Thread Keno Fischer
> I guess this calls for some defines in 9p.h: > > /* 9p2000.L says that the 'flags' argument of operation 'xattrcreate' > * are derived from Linux setxattr. > */ > #define P9_XATTR_CREATE 1 > #define P9_XATTR_REPLACE 2 > > Please do that in a preparatory patch. > > I would also appreciate you

[Qemu-devel] [PATCH v2 16/20] 9p: darwin: Compatibility for f/l*xattr

2018-05-31 Thread Keno Fischer
On darwin `fgetxattr` takes two extra optional arguments, and the l* variants are not defined (in favor of an extra flag to the regular variants. Signed-off-by: Keno Fischer --- Changes from v1: New patch, qemu_fgetxattr had previously been moved to 9p-util as fgetxattr_follow. The remaining

[Qemu-devel] [PATCH v2 20/20] 9p: darwin: configure: Allow VirtFS on Darwin

2018-05-31 Thread Keno Fischer
Signed-off-by: Keno Fischer --- Changes from v1: Now builds the proxy-helper on Darwin. Makefile.objs | 1 + configure | 22 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index c6c3554..a2245c9 100644

[Qemu-devel] [PATCH v2 18/20] 9p: darwin: Implement compatibility for mknodat

2018-05-31 Thread Keno Fischer
there is a solution: Darwin as an (unexposed in the C library) system call that sets the cwd for the current thread only. This should suffice to use mknod safely. Signed-off-by: Keno Fischer --- Changes from v1: New patch. The previous series marked mknodat unsupported. hw/9pfs/9p-local.c | 5

[Qemu-devel] [PATCH v2 19/20] 9p: darwin: virtfs-proxy: Implement setuid code for darwin

2018-05-31 Thread Keno Fischer
. I had originally done this when I thought it made sense to have only one `setugid` function, but I retained this because it seems clearer this way. Signed-off-by: Keno Fischer --- Changes from v1: New patch. fsdev/virtfs-proxy-helper.c | 200 +++- 1

[Qemu-devel] [PATCH v2 12/20] 9p: darwin: Explicitly cast comparisons of mode_t with -1

2018-05-31 Thread Keno Fischer
Comparisons of mode_t with -1 require an explicit cast, since mode_t is unsigned on Darwin. Signed-off-by: Keno Fischer --- Changes from v1: Split from strchrnul change hw/9pfs/9p-local.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p

[Qemu-devel] [PATCH v2 15/20] 9p: darwin: *xattr_nofollow implementations

2018-05-31 Thread Keno Fischer
This implements the darwin equivalent of the functions that were moved to 9p-util(-linux) earlier in this series in the new 9p-util-darwin file. Signed-off-by: Keno Fischer --- Changes from v1: * New 9p-util-darwin.c rather than ifdefs in 9p-util.c * Drop incorrect AT_NOFOLLOW from the actual

[Qemu-devel] [PATCH v2 17/20] 9p: darwin: Provide a fallback implementation for utimensat

2018-05-31 Thread Keno Fischer
other than Apple clang that may not support this builtin. Signed-off-by: Keno Fischer --- Changes from v1: * Correct calculation of tv_usec * Support UTIME_NOW/UTIME/OMIT * Now covers fsdev/virtfs-proxy-helper.c fsdev/virtfs-proxy-helper.c | 3 +- hw/9pfs/9p-local.c | 2 +- hw

[Qemu-devel] [PATCH v2 10/20] 9p: darwin: Handle struct stat(fs) differences

2018-05-31 Thread Keno Fischer
Signed-off-by: Keno Fischer --- Changes since v1: * Now also covers fsdev/virtfs-proxy-helper.c fsdev/virtfs-proxy-helper.c | 14 +++--- hw/9pfs/9p-proxy.c | 17 ++--- hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c| 16 ++-- 4 files

[Qemu-devel] [PATCH v2 09/20] 9p: Properly check/translate flags in unlinkat

2018-05-31 Thread Keno Fischer
to the 9p unlinkat server code. Signed-off-by: Keno Fischer --- Changes since v1: * Code was moved from 9p-local.c to server entry point in 9p.c hw/9pfs/9p.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index b80db65..a757374 100644

[Qemu-devel] [PATCH v2 14/20] 9p: darwin: Provide a compatibility definition for XATTR_SIZE_MAX

2018-05-31 Thread Keno Fischer
Signed-off-by: Keno Fischer --- No change from v1. hw/9pfs/9p.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 70cfab9..24802b9 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3374,6 +3374,13 @@ out_nofid: v9fs_string_free

[Qemu-devel] [PATCH v2 08/20] 9p: Rename 9p-util -> 9p-util-linux

2018-05-31 Thread Keno Fischer
The current file only has the Linux versions of these functions. Rename the file accordingly and update the Makefile to only build it on Linux. A Darwin version of these will follow later in the series. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p-util-linux.c | 59

[Qemu-devel] [PATCH v2 13/20] 9p: darwin: Ignore O_{NOATIME, DIRECT}

2018-05-31 Thread Keno Fischer
Darwin doesn't have either of these flags. Darwin does have F_NOCACHE, which is similar to O_DIRECT, but has different enough semantics that other projects don't generally map them automatically. In any case, we don't support O_DIRECT on Linux at the moment either. Signed-off-by: Keno Fischer

[Qemu-devel] [PATCH v2 07/20] 9p: Move a couple xattr functions to 9p-util

2018-05-31 Thread Keno Fischer
These functions will need custom implementations on Darwin. Since the implementation is very similar among all of them, and 9p-util already has the _nofollow version of fgetxattrat, let's move them all there. Signed-off-by: Keno Fischer --- Changes since v1: * fgetxattr_follow is dropped

[Qemu-devel] [PATCH v2 05/20] 9p: Properly set errp in fstatfs error path

2018-05-31 Thread Keno Fischer
In the review of 9p: Avoid warning if FS_IOC_GETVERSION is not defined Grep Kurz noted this error path was failing to set errp. Fix that. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p-local.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/9pfs/9p

[Qemu-devel] [PATCH v2 06/20] 9p: Avoid warning if FS_IOC_GETVERSION is not defined

2018-05-31 Thread Keno Fischer
Both `stbuf` and `local_ioc_getversion` where unused when FS_IOC_GETVERSION was not defined, causing a compiler warning. Reorgnaize the code to avoid this warning. Signed-off-by: Keno Fischer --- Changes since v1: * As request in review, logic is factored into a local_ioc_getversion_init

[Qemu-devel] [PATCH v2 11/20] 9p: darwin: Handle struct dirent differences

2018-05-31 Thread Keno Fischer
On darwin d_seekoff exists, but is optional and does not seem to be commonly used by file systems. Use `telldir` instead to obtain the seek offset. Signed-off-by: Keno Fischer --- Changes since v1: * Drop setting d_seekoff in synth_direntry * Factor telldir vs d_off logic

[Qemu-devel] [PATCH v2 02/20] 9p: proxy: Fix size passed to `connect`

2018-05-31 Thread Keno Fischer
The size to pass to the `connect` call is the size of the entire `struct sockaddr_un`. Passing anything shorter than this causes errors on darwin. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p-proxy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[Qemu-devel] [PATCH v2 04/20] 9p: linux: Fix a couple Linux assumptions

2018-05-31 Thread Keno Fischer
- Guard Linux only headers. - Add qemu/statfs.h header to abstract over the which headers are needed for struct statfs - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno Fischer --- Changes since v1: * New qemu/statfs.h header

[Qemu-devel] [PATCH v2 03/20] 9p: xattr: Fix crash due to free of uninitialized value

2018-05-31 Thread Keno Fischer
that is safe to pass to g_free, likely NULL. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index d74302d..b80db65 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3256,8

[Qemu-devel] [PATCH v2 01/20] cutils: Provide strchrnul

2018-05-31 Thread Keno Fischer
the replacement pattern in a place where strchrnul could be used. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p-local.c| 2 +- include/qemu/cutils.h | 1 + monitor.c | 8 ++-- util/cutils.c | 13 + util/qemu-option.c| 6 +- util

[Qemu-devel] [PATCH v2 00/20] 9p: Add support for Darwin

2018-05-31 Thread Keno Fischer
This is v2 of my patch series to provide 9p server support for Darwin. The patches in this series address review from v1, now support building the virtfs proxy, as well as fix bugs found since v1. Keno Fischer (20): cutils: Provide strchrnul 9p: proxy: Fix size passed to `connect` 9p

Re: [Qemu-devel] [PATCH 11/13] 9p: darwin: Mark mknod as unsupported

2018-05-31 Thread Keno Fischer
On Thu, May 31, 2018 at 7:06 PM, Keno Fischer wrote: > On Thu, May 31, 2018 at 6:56 PM, Keno Fischer wrote: >>>> My concern was that allowing this would cause unexpected >>>> behavior, since the device numbers will differ between OS X >>>> and Linux. Tho

Re: [Qemu-devel] [PATCH 11/13] 9p: darwin: Mark mknod as unsupported

2018-05-31 Thread Keno Fischer
On Thu, May 31, 2018 at 6:56 PM, Keno Fischer wrote: >>> My concern was that allowing this would cause unexpected >>> behavior, since the device numbers will differ between OS X >>> and Linux. Though maybe this isn't the place to worry about >>> that. >&g

Re: [Qemu-devel] [PATCH 11/13] 9p: darwin: Mark mknod as unsupported

2018-05-31 Thread Keno Fischer
>> My concern was that allowing this would cause unexpected >> behavior, since the device numbers will differ between OS X >> and Linux. Though maybe this isn't the place to worry about >> that. > > The numbers may differ indeed but we don't really care since the > server never opens device files.

Re: [Qemu-devel] [PATCH 06/13] 9p: darwin: Address minor differences

2018-05-31 Thread Keno Fischer
Well, I do have the patch already to switch this and the other patterns, so let me know if you want it or not ;). On Thu, May 31, 2018 at 3:22 PM, Greg Kurz wrote: > On Thu, 31 May 2018 12:27:35 -0400 > Keno Fischer wrote: > >> >> --- a/hw/9pfs/9p-local.c >>

Re: [Qemu-devel] [PATCH 13/13] 9p: darwin: configure: Allow VirtFS on Darwin

2018-05-31 Thread Keno Fischer
>> +elif test "$darwin" = yes; then >>virtfs=yes >> - tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" > > So, no proxy helper on Darwin ? Why ? The limitation should be mentioned in > the changelog at least. I just had no use for it. I'll try to build it and see what happens.

Re: [Qemu-devel] [PATCH 03/13] 9p: Move a couple xattr functions to 9p-util

2018-05-31 Thread Keno Fischer
> Oops you're right... so we indeed need to handle this conflicting APIs, > but fgetxattr_follow() is inapropriate, because fgetxattr() has nothing > to follow since it already has an fd... The same goes with Darwin's > version actually. The "nofollow" thingy only makes sense for those calls >

Re: [Qemu-devel] [PATCH 11/13] 9p: darwin: Mark mknod as unsupported

2018-05-31 Thread Keno Fischer
>> +#ifdef CONFIG_DARWIN >> +/* Darwin doesn't have mknodat and it's unlikely to work anyway, > > What's unlikely to work ? > My concern was that allowing this would cause unexpected behavior, since the device numbers will differ between OS X and Linux. Though maybe this isn't the place to

Re: [Qemu-devel] [PATCH 08/13] 9p: darwin: Ignore O_{NOATIME, DIRECT}

2018-05-31 Thread Keno Fischer
> > Please don't kill the spaces. > Sorry, will undo. My editor has strong opinions about styling. >> +#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 >> +

Re: [Qemu-devel] [PATCH 06/13] 9p: darwin: Address minor differences

2018-05-31 Thread Keno Fischer
>> --- a/hw/9pfs/9p-local.c >> +++ b/hw/9pfs/9p-local.c >> @@ -67,7 +67,10 @@ int local_open_nofollow(FsContext *fs_ctx, const char >> *path, int flags, >> assert(*path != '/'); >> >> head = g_strdup(path); >> -c = strchrnul(path, '/'); >> +/* equivalent to

Re: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag

2018-05-31 Thread Keno Fischer
>> +errno = EINVAL; >> +return -1; > > ... I'm more concerned about this new error path. How can this happen ? > As far as I can tell, the flags come from the client without any intermediate error checking. Since the Darwin constants do not match the Linux constants (which have

Re: [Qemu-devel] [PATCH 05/13] 9p: darwin: Handle struct dirent differences

2018-05-31 Thread Keno Fischer
>> diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c >> index eb68b42..3c0a6d8 100644 >> --- a/hw/9pfs/9p-synth.c >> +++ b/hw/9pfs/9p-synth.c >> @@ -221,7 +221,11 @@ static void synth_direntry(V9fsSynthNode *node, >> { >> strcpy(entry->d_name, node->name); >> entry->d_ino =

Re: [Qemu-devel] [PATCH 03/13] 9p: Move a couple xattr functions to 9p-util

2018-05-31 Thread Keno Fischer
> I'm ok with this move, but if the functions need to have distinct > implementations, and they really do according to patch 10, then > I'd rather have distinct files and rely on conditional building in > the makefile. Maybe rename the current file to 9p-util-linux.c > and introduce a

Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions

2018-05-26 Thread Keno Fischer
>>> diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h >>> index 3fa062b..a13e729 100644 >>> --- a/fsdev/file-op-9p.h >>> +++ b/fsdev/file-op-9p.h >>> @@ -16,7 +16,9 @@ >>> >>> #include >>> #include >>> +#ifdef CONFIG_LINUX >> >> What about a less restrictive: >> >> #ifndef __APPLE__ > > In

Re: [Qemu-devel] [PATCH 09/13] 9p: darwin: Provide a compatibility definition for XATTR_SIZE_MAX

2018-05-26 Thread Keno Fischer
> > +#if defined(CONFIG_DARWIN) && !defined(XATTR_SIZE_MAX) > > +/* Darwin doesn't seem to define a maximum xattr size in its user > > + user space header, but looking at the kernel source, HFS supports > > + up to INT32_MAX, so use that as the maximum. > > +*/ > > +#define XATTR_SIZE_MAX

[Qemu-devel] [PATCH v2] 9pfs: Correctly handle cancelled requests

2017-12-04 Thread Keno Fischer
mit/9523feac272ccad2ad8186ba4fcc89103754de52 Signed-off-by: Keno Fischer <k...@juliacomputing.com> --- Changes from v1: - In reponse to review by Greg Kurz, add a new transport layer operation to discard the buffer. I also attempted an implementation for xen, but I have done no verification on that beyond ma

[Qemu-devel] [PATCH] 9pfs: Correctly handle cancelled requests

2017-12-02 Thread Keno Fischer
NTR. I believe this is true of the current code. [1] https://9fans.github.io/plan9port/man/man9/flush.html [2] https://github.com/torvalds/linux/commit/9523feac272ccad2ad8186ba4fcc89103754de52 Signed-off-by: Keno Fischer <k...@juliacomputing.com> --- hw/9pfs/9p.c | 17