--- include/qemu/madvise.h.orig 2022-04-21 16:24:08.000000000 -0700 +++ include/qemu/madvise.h 2022-04-21 16:24:57.000000000 -0700 @@ -13,7 +13,11 @@ #if defined(CONFIG_MADVISE) #define QEMU_MADV_WILLNEED MADV_WILLNEED +#ifdef MADV_DONTNEED #define QEMU_MADV_DONTNEED MADV_DONTNEED +#else +#define QEMU_MADV_DONTNEED QEMU_MADV_INVALID +#endif #ifdef MADV_DONTFORK #define QEMU_MADV_DONTFORK MADV_DONTFORK #else