On 23/07/2015 17:25, Michael S. Tsirkin wrote: > > +#ifdef CONFIG_LINUX > > + > > +#ifndef F_LINUX_SPECIFIC_BASE > > +#define F_LINUX_SPECIFIC_BASE 1024 > > +#endif > > + > > +#ifndef F_ADD_SEALS > > +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) > > +#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) > > + > > +#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ > > +#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ > > +#define F_SEAL_GROW 0x0004 /* prevent file from growing */ > > +#define F_SEAL_WRITE 0x0008 /* prevent writes */ > > +#endif > > These are from include/uapi/linux/fcntl.h, > they should be imported into linux-headers I think.
linux-headers is usually used for virt-related features that we want in QEMU a few weeks before they are distributed upstream. Here, I think just including linux/fcntl.h is enough. >> +#ifndef __NR_memfd_create >> +# if defined __x86_64__ >> +# define __NR_memfd_create 319 >> +# elif defined __arm__ >> +# define __NR_memfd_create 385 >> +# elif defined __aarch64__ >> +# define __NR_memfd_create 279 >> +# elif defined _MIPS_SIM >> +# if _MIPS_SIM == _MIPS_SIM_ABI32 >> +# define __NR_memfd_create 4354 >> +# endif >> +# if _MIPS_SIM == _MIPS_SIM_NABI32 >> +# define __NR_memfd_create 6318 >> +# endif >> +# if _MIPS_SIM == _MIPS_SIM_ABI64 >> +# define __NR_memfd_create 5314 >> +# endif > > What's defining all these macros? They're in asm/unistd.h. I think that, instead of making qemu/osdep.h the new qemu-common.h, the wrappers added by patch 3 should be declared in a new header qemu/memfd.h. The implementation in util/memfd.c can include both linux/fcntl.h and asm/unistd.h. Paolo