Skip to content

7.0.0-rc2 hw/9pfs/9p.h cannot find XATTR_SIZE_MAX

Host environment

Dockerfile

Emulated/Virtualized environment

Description of problem

[844/2583] Compiling C object tests/qtest/qos-test.p/virtio-rng-test.c.o
ninja: job failed: clang -m64 -mcx16 -Itests/qtest/qos-test.p -Itests/qtest -I../tests/qtest -I. -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -flto -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -isystem /home/dummy/qemu-7.0.0-rc2/linux-headers -isystem linux-headers -iquote . -iquote /home/dummy/qemu-7.0.0-rc2 -iquote /home/dummy/qemu-7.0.0-rc2/include -iquote /home/dummy/qemu-7.0.0-rc2/disas/libvixl -iquote /home/dummy/qemu-7.0.0-rc2/tcg/i386 -pthread -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -fstack-protector-strong -fsanitize=cfi-icall -fsanitize-cfi-icall-generalize-pointers -fPIE -MD -MQ tests/qtest/qos-test.p/virtio-9p-test.c.o -MF tests/qtest/qos-test.p/virtio-9p-test.c.o.d -o tests/qtest/qos-test.p/virtio-9p-test.c.o -c ../tests/qtest/virtio-9p-test.c
In file included from ../tests/qtest/virtio-9p-test.c:18:
/home/dummy/qemu-7.0.0-rc2/hw/9pfs/9p.h:497:2: error: Missing definition for P9_XATTR_SIZE_MAX for this host system
#error Missing definition for P9_XATTR_SIZE_MAX for this host system
 ^
1 error generated.
ninja: subcommand failed
make[1]: *** [Makefile:163: run-ninja] Error 1
make[1]: Leaving directory '/home/dummy/qemu-7.0.0-rc2/build'
make: *** [GNUmakefile:11: all] Error 2
The command '/bin/sh -c make -j"`grep -c '^processor' /proc/cpuinfo`"' returned a non-zero code: 2

Steps to reproduce

  1. build with attached Dockerfile

Additional information

This problem is introduced by lore.kernel.org/all/20220227223522.91937-7-wwcohen@gmail.com/

XATTR_SIZE_MAX is in <linux/limits.h> which is included by 9p.c but not 9p.h. However the 9p.h checks existence of XATTR_SIZE_MAX, so any other file including 9p.h would be illegal. This is clearly misplacement of header including.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information