Skip to content

Commit eb8b1a7

Browse files
FlyGoathuth
authored andcommitted
accel/kvm: avoid using predefined PAGE_SIZE
As per POSIX specification of limits.h [1], OS libc may define PAGE_SIZE in limits.h. PAGE_SIZE is used in included kernel uapi headers. To prevent collosion of definition, we discard PAGE_SIZE from defined by libc and take QEMU's variable. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Message-Id: <20210118063808.12471-8-jiaxun.yang@flygoat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent d2c4f38 commit eb8b1a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

accel/kvm/kvm-all.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
5959
* need to use the real host PAGE_SIZE, as that's what KVM will use.
6060
*/
61+
#ifdef PAGE_SIZE
62+
#undef PAGE_SIZE
63+
#endif
6164
#define PAGE_SIZE qemu_real_host_page_size
6265

6366
//#define DEBUG_KVM

0 commit comments

Comments
 (0)