Re: [Qemu-devel] [PATCH] 9pfs: include for XATTR_SIZE_MAX
On Mon, Jun 26, 2017 at 09:20:45PM +0200, Patrick Steinhardt wrote: > The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX` > to reject attempts of creating xattrs with an invalid size, which is > defined in . On glibc-based systems, this header is > indirectly included via , , > , but on other platforms this is not guaranteed due > to not being part of the POSIX standard. One examples are systems based > on musl libc, which do not include the indirectly, > which leads to `XATTR_SIZE_MAX` being undefined. > > Fix this error by directly include . As the 9P fs code > is being Linux-based either way, we can simply do so without breaking > other platforms. This enables building 9pfs on musl-based systems. > > Signed-off-by: Patrick Steinhardt <p...@pks.im> > --- > hw/9pfs/9p.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c > index 96d2683348..48cd558e96 100644 > --- a/hw/9pfs/9p.c > +++ b/hw/9pfs/9p.c > @@ -13,6 +13,7 @@ > > #include "qemu/osdep.h" > #include > +#include > #include "hw/virtio/virtio.h" > #include "qapi/error.h" > #include "qemu/error-report.h" > -- > 2.13.2 > Another ping on this patch. I think in the end all agreed this patch is sane, but the thread has been derailed by the patchew-discussion. So any further comments regarding this patch or can it be submitted as is? Regards Patrick signature.asc Description: PGP signature
Re: [Qemu-devel] [PATCH] 9pfs: include for XATTR_SIZE_MAX
On Fri, Jul 28, 2017 at 02:20:49PM -0300, Philippe Mathieu-Daudé wrote: > > On Mon, Jun 26, 2017 at 12:20 PM, Patrick Steinhardt <p...@pks.im> wrote: > >> The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX` > >> to reject attempts of creating xattrs with an invalid size, which is > >> defined in . On glibc-based systems, this header is > >> indirectly included via , , > >> , but on other platforms this is not guaranteed due > >> to not being part of the POSIX standard. One examples are systems based > >> on musl libc, which do not include the indirectly, > >> which leads to `XATTR_SIZE_MAX` being undefined. > >> > >> Fix this error by directly include . As the 9P fs code > >> is being Linux-based either way, we can simply do so without breaking > >> other platforms. This enables building 9pfs on musl-based systems. > >> > >> Signed-off-by: Patrick Steinhardt <p...@pks.im> > > Reviewed-by: Alistair Francis <alistair.fran...@xilinx.com> > >> --- > >> hw/9pfs/9p.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c > >> index 96d2683348..48cd558e96 100644 > >> --- a/hw/9pfs/9p.c > >> +++ b/hw/9pfs/9p.c > >> @@ -13,6 +13,7 @@ > >> > >> #include "qemu/osdep.h" > >> #include > > This is likely to break on BSD, but now than patchew has a NetBSD job > you can trigger a build RESENDing this patch. > > This should probably work: > > #ifdef __linux__ > > >> +#include > > #endif > > >> #include "hw/virtio/virtio.h" > >> #include "qapi/error.h" > >> #include "qemu/error-report.h" > >> -- > >> 2.13.2 > > Regards, > > Phil. Thanks for the feedback! Is this really relevant in this context, though? Both 9p-local.c and 9p-handle.c already include linux headers, especially is included without any ifdef around. As such, I simply assumed that this code is being built on Linux systems, only. Regards Patrick signature.asc Description: PGP signature
[Qemu-devel] [PATCH] 9pfs: include for XATTR_SIZE_MAX
The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX` to reject attempts of creating xattrs with an invalid size, which is defined in . On glibc-based systems, this header is indirectly included via , , , but on other platforms this is not guaranteed due to not being part of the POSIX standard. One examples are systems based on musl libc, which do not include the indirectly, which leads to `XATTR_SIZE_MAX` being undefined. Fix this error by directly include . As the 9P fs code is being Linux-based either way, we can simply do so without breaking other platforms. This enables building 9pfs on musl-based systems. Signed-off-by: Patrick Steinhardt <p...@pks.im> --- hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 96d2683348..48cd558e96 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include +#include #include "hw/virtio/virtio.h" #include "qapi/error.h" #include "qemu/error-report.h" -- 2.13.2