qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9pfs: fix missing sys/mount.h include
@ 2022-10-28 11:21 Christian Schoenebeck
  2022-10-28 11:42 ` Thomas Huth
  2022-10-28 13:39 ` Bin Meng
  0 siblings, 2 replies; 5+ messages in thread
From: Christian Schoenebeck @ 2022-10-28 11:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Greg Kurz, Thomas Huth, Stefan Hajnoczi, Warner Losh, Bin Meng

Fixes the following build error:

  fsdev/file-op-9p.h:156:56: error: declaration of 'struct statfs' will
  not be visible outside of this function [-Werror,-Wvisibility]
    int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
                                                       ^

As Windows neither has statfs, nor sys/mount.h, don't include it there.

Fixes: 684f91203439 ("tests/9p: split virtio-9p-test.c ...")
Link: https://lore.kernel.org/all/2690108.PsDodiG1Zx@silver/
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 fsdev/file-op-9p.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
index 4997677460..700f1857b4 100644
--- a/fsdev/file-op-9p.h
+++ b/fsdev/file-op-9p.h
@@ -24,6 +24,8 @@
 #endif
 #ifdef CONFIG_DARWIN
 # include <sys/param.h>
+#endif
+#ifndef CONFIG_WIN32
 # include <sys/mount.h>
 #endif
 
-- 
2.30.2



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

* Re: [PATCH] 9pfs: fix missing sys/mount.h include
  2022-10-28 11:21 [PATCH] 9pfs: fix missing sys/mount.h include Christian Schoenebeck
@ 2022-10-28 11:42 ` Thomas Huth
  2022-10-28 12:14   ` Christian Schoenebeck
  2022-10-28 13:39 ` Bin Meng
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2022-10-28 11:42 UTC (permalink / raw)
  To: Christian Schoenebeck, qemu-devel
  Cc: Greg Kurz, Stefan Hajnoczi, Warner Losh, Bin Meng

On 28/10/2022 13.21, Christian Schoenebeck wrote:
> Fixes the following build error:
> 
>    fsdev/file-op-9p.h:156:56: error: declaration of 'struct statfs' will
>    not be visible outside of this function [-Werror,-Wvisibility]
>      int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
>                                                         ^
> 
> As Windows neither has statfs, nor sys/mount.h, don't include it there.
> 
> Fixes: 684f91203439 ("tests/9p: split virtio-9p-test.c ...")
> Link: https://lore.kernel.org/all/2690108.PsDodiG1Zx@silver/
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>   fsdev/file-op-9p.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
> index 4997677460..700f1857b4 100644
> --- a/fsdev/file-op-9p.h
> +++ b/fsdev/file-op-9p.h
> @@ -24,6 +24,8 @@
>   #endif
>   #ifdef CONFIG_DARWIN
>   # include <sys/param.h>
> +#endif
> +#ifndef CONFIG_WIN32
>   # include <sys/mount.h>
>   #endif

Do you feel confident that this will also work on other exotic systems? 
(e.g. does it work with "make vm-build-haiku.x86_64" ?)
Otherwise it might be better to add a meson.build test for this header instead.

  Thomas



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

* Re: [PATCH] 9pfs: fix missing sys/mount.h include
  2022-10-28 11:42 ` Thomas Huth
@ 2022-10-28 12:14   ` Christian Schoenebeck
  2022-10-28 12:27     ` Thomas Huth
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Schoenebeck @ 2022-10-28 12:14 UTC (permalink / raw)
  To: qemu-devel, Thomas Huth; +Cc: Greg Kurz, Stefan Hajnoczi, Warner Losh, Bin Meng

On Friday, October 28, 2022 1:42:34 PM CEST Thomas Huth wrote:
> On 28/10/2022 13.21, Christian Schoenebeck wrote:
> > Fixes the following build error:
> > 
> >    fsdev/file-op-9p.h:156:56: error: declaration of 'struct statfs' will
> >    not be visible outside of this function [-Werror,-Wvisibility]
> >      int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
> >                                                         ^
> > 
> > As Windows neither has statfs, nor sys/mount.h, don't include it there.
> > 
> > Fixes: 684f91203439 ("tests/9p: split virtio-9p-test.c ...")
> > Link: https://lore.kernel.org/all/2690108.PsDodiG1Zx@silver/
> > Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> > ---
> >   fsdev/file-op-9p.h | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
> > index 4997677460..700f1857b4 100644
> > --- a/fsdev/file-op-9p.h
> > +++ b/fsdev/file-op-9p.h
> > @@ -24,6 +24,8 @@
> >   #endif
> >   #ifdef CONFIG_DARWIN
> >   # include <sys/param.h>
> > +#endif
> > +#ifndef CONFIG_WIN32
> >   # include <sys/mount.h>
> >   #endif
> 
> Do you feel confident that this will also work on other exotic systems? 
> (e.g. does it work with "make vm-build-haiku.x86_64" ?)
> Otherwise it might be better to add a meson.build test for this header instead.

9pfs only supports Linux and macOS ATM, and Windows being WIP. From
meson.buid:

have_virtfs = get_option('virtfs') \
    .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()

And Bin Meng just sent a related patch to fix building 9pfs tests
unconditionally:

https://lore.kernel.org/all/20221028045736.679903-9-bin.meng@windriver.com/

Best regards,
Christian Schoenebeck




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

* Re: [PATCH] 9pfs: fix missing sys/mount.h include
  2022-10-28 12:14   ` Christian Schoenebeck
@ 2022-10-28 12:27     ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2022-10-28 12:27 UTC (permalink / raw)
  To: Christian Schoenebeck, qemu-devel
  Cc: Greg Kurz, Stefan Hajnoczi, Warner Losh, Bin Meng

On 28/10/2022 14.14, Christian Schoenebeck wrote:
> On Friday, October 28, 2022 1:42:34 PM CEST Thomas Huth wrote:
>> On 28/10/2022 13.21, Christian Schoenebeck wrote:
>>> Fixes the following build error:
>>>
>>>     fsdev/file-op-9p.h:156:56: error: declaration of 'struct statfs' will
>>>     not be visible outside of this function [-Werror,-Wvisibility]
>>>       int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
>>>                                                          ^
>>>
>>> As Windows neither has statfs, nor sys/mount.h, don't include it there.
>>>
>>> Fixes: 684f91203439 ("tests/9p: split virtio-9p-test.c ...")
>>> Link: https://lore.kernel.org/all/2690108.PsDodiG1Zx@silver/
>>> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
>>> ---
>>>    fsdev/file-op-9p.h | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
>>> index 4997677460..700f1857b4 100644
>>> --- a/fsdev/file-op-9p.h
>>> +++ b/fsdev/file-op-9p.h
>>> @@ -24,6 +24,8 @@
>>>    #endif
>>>    #ifdef CONFIG_DARWIN
>>>    # include <sys/param.h>
>>> +#endif
>>> +#ifndef CONFIG_WIN32
>>>    # include <sys/mount.h>
>>>    #endif
>>
>> Do you feel confident that this will also work on other exotic systems?
>> (e.g. does it work with "make vm-build-haiku.x86_64" ?)
>> Otherwise it might be better to add a meson.build test for this header instead.
> 
> 9pfs only supports Linux and macOS ATM, and Windows being WIP.
Ok, makes sense now, thanks!

  Thomas



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

* Re: [PATCH] 9pfs: fix missing sys/mount.h include
  2022-10-28 11:21 [PATCH] 9pfs: fix missing sys/mount.h include Christian Schoenebeck
  2022-10-28 11:42 ` Thomas Huth
@ 2022-10-28 13:39 ` Bin Meng
  1 sibling, 0 replies; 5+ messages in thread
From: Bin Meng @ 2022-10-28 13:39 UTC (permalink / raw)
  To: Christian Schoenebeck
  Cc: qemu-devel, Greg Kurz, Thomas Huth, Stefan Hajnoczi, Warner Losh,
	Bin Meng

On Fri, Oct 28, 2022 at 7:30 PM Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> Fixes the following build error:
>
>   fsdev/file-op-9p.h:156:56: error: declaration of 'struct statfs' will
>   not be visible outside of this function [-Werror,-Wvisibility]
>     int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
>                                                        ^
>
> As Windows neither has statfs, nor sys/mount.h, don't include it there.
>
> Fixes: 684f91203439 ("tests/9p: split virtio-9p-test.c ...")
> Link: https://lore.kernel.org/all/2690108.PsDodiG1Zx@silver/
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>  fsdev/file-op-9p.h | 2 ++
>  1 file changed, 2 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


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

end of thread, other threads:[~2022-10-28 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 11:21 [PATCH] 9pfs: fix missing sys/mount.h include Christian Schoenebeck
2022-10-28 11:42 ` Thomas Huth
2022-10-28 12:14   ` Christian Schoenebeck
2022-10-28 12:27     ` Thomas Huth
2022-10-28 13:39 ` Bin Meng

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).