[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] 9p: move P9_XATTR_SIZE_MAX from 9p.h to 9p.c
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2] 9p: move P9_XATTR_SIZE_MAX from 9p.h to 9p.c |
Date: |
Thu, 31 Mar 2022 21:00:07 +0100 |
On Thu, 31 Mar 2022 at 19:27, Will Cohen <wwcohen@gmail.com> wrote:
>
> The patch set adding 9p functionality to darwin introduced an issue
> where limits.h, which defines XATTR_SIZE_MAX, is included in 9p.c,
> though the referenced constant is needed in 9p.h. This commit fixes that
> issue by moving the definition of P9_XATTR_SIZE_MAX, which uses
> XATTR_SIZE_MAX, to also be in 9p.c.
>
> Additionally, this commit moves the location of the system headers
> include in 9p.c to occur before the project headers.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/950
> Fixes: 38d7fd68b0 ("9p: darwin: Move XATTR_SIZE_MAX->P9_XATTR_SIZE_MAX")
>
> Signed-off-by: Will Cohen <wwcohen@gmail.com>
> ---
> hw/9pfs/9p.c | 28 +++++++++++++++++++++++-----
> hw/9pfs/9p.h | 18 ------------------
> 2 files changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index dcaa602d4c..b9152c7882 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -16,6 +16,11 @@
> * https://wiki.qemu.org/Documentation/9p
> */
>
> +#ifdef CONFIG_LINUX
> +#include <linux/limits.h>
> +#else
> +#include <limits.h>
> +#endif
> #include "qemu/osdep.h"
osdep.h must always be the first include line in any .c file.
thanks
-- PMM