qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] 9pfs: fix missing sys/mount.h include


From: Thomas Huth
Subject: Re: [PATCH] 9pfs: fix missing sys/mount.h include
Date: Fri, 28 Oct 2022 14:27:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]