[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions |
Date: |
Sat, 26 May 2018 03:30:26 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Hi Keno,
On 05/26/2018 02:23 AM, address@hidden wrote:
> From: Keno Fischer <address@hidden>
>
> - Guard two Linux only headers.
> - Define `ENOATTR` only if not only defined
> (it's defined in system headers on Darwin).
>
> Signed-off-by: Keno Fischer <address@hidden>
> ---
> fsdev/file-op-9p.h | 2 ++
> hw/9pfs/9p-local.c | 2 ++
> include/qemu/xattr.h | 4 +++-
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
> 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 <dirent.h>
> #include <utime.h>
> +#ifdef CONFIG_LINUX
What about a less restrictive:
#ifndef __APPLE__
> #include <sys/vfs.h>
> +#endif
> #include "qemu-fsdev-throttle.h"
>
> #define SM_LOCAL_MODE_BITS 0600
> diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
> index b37b1db..f6c7526 100644
> --- a/hw/9pfs/9p-local.c
> +++ b/hw/9pfs/9p-local.c
> @@ -27,10 +27,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/include/qemu/xattr.h b/include/qemu/xattr.h
> index a83fe8e..f1d0f7b 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
>
Rest looks correct.