1Message-Id: <07010a2ad79559c412949f0005dbe3cb03d8416e.1498504812.git.ps@pks.im>
2From: Patrick Steinhardt <ps@pks.im>
3Date: Mon, 26 Jun 2017 21:20:45 +0200
4Subject: [PATCH] 9pfs: include <linux/limits.h> for XATTR_SIZE_MAX
5
6The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX`
7to reject attempts of creating xattrs with an invalid size, which is
8defined in <linux/limits.h>. On glibc-based systems, this header is
9indirectly included via <limits.h>, <bits/posix1_lim.h>,
10<bitts/local_lim.h>, but on other platforms this is not guaranteed due
11to not being part of the POSIX standard. One examples are systems based
12on musl libc, which do not include the <linux/limits.h> indirectly,
13which leads to `XATTR_SIZE_MAX` being undefined.
14
15Fix this error by directly include <linux/limits.h>. As the 9P fs code
16is being Linux-based either way, we can simply do so without breaking
17other platforms. This enables building 9pfs on musl-based systems.
18
19Signed-off-by: Patrick Steinhardt <ps@pks.im>
20[ Changes by AF
21 - Apply to the QEMU tree inside of Xen
22]
23Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
24---
25Upstream Status: Pending review and acceptance
26
27 tools/qemu-xen/hw/9pfs/9p.c | 1 +
28 1 file changed, 1 insertion(+)
29
30diff --git a/tools/qemu-xen/hw/9pfs/9p.c b/tools/qemu-xen/hw/9pfs/9p.c
31index 96d2683348..48cd558e96 100644
32--- a/tools/qemu-xen/hw/9pfs/9p.c
33+++ b/tools/qemu-xen/hw/9pfs/9p.c
34@@ -13,6 +13,7 @@
35
36 #include "qemu/osdep.h"
37 #include <glib/gprintf.h>
38+#include <linux/limits.h>
39 #include "hw/virtio/virtio.h"
40 #include "qapi/error.h"
41 #include "qemu/error-report.h"
42--
432.13.2
44