0001-9pfs-include-linux-limits.h-for-XATTR_SIZE_MAX.patch 1.6 KB

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