diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2021-01-18 14:38:05 +0800 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2021-01-20 10:46:54 +0100 |
commit | d2c4f3841d1cba17c99f76812ffcb75a6c402202 (patch) | |
tree | 338680b9d8a259330839568b545d8bca0b04d0ec /tests/qtest/libqos | |
parent | 2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0 (diff) |
tests: Rename PAGE_SIZE definitions
As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.
Self defined PAGE_SIZE is frequently used in tests, to prevent
collosion of definition, we give PAGE_SIZE definitons reasonable
prefixs.
[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210118063808.12471-7-jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/libqos')
-rw-r--r-- | tests/qtest/libqos/malloc-pc.c | 4 | ||||
-rw-r--r-- | tests/qtest/libqos/malloc-spapr.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c index 16ff9609cc..f1e3b392a5 100644 --- a/tests/qtest/libqos/malloc-pc.c +++ b/tests/qtest/libqos/malloc-pc.c @@ -18,7 +18,7 @@ #include "qemu-common.h" -#define PAGE_SIZE (4096) +#define ALLOC_PAGE_SIZE (4096) void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) { @@ -26,7 +26,7 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) QFWCFG *fw_cfg = pc_fw_cfg_init(qts); ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE); - alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE); + alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), ALLOC_PAGE_SIZE); /* clean-up */ pc_fw_cfg_uninit(fw_cfg); diff --git a/tests/qtest/libqos/malloc-spapr.c b/tests/qtest/libqos/malloc-spapr.c index 84862e4876..05b306c191 100644 --- a/tests/qtest/libqos/malloc-spapr.c +++ b/tests/qtest/libqos/malloc-spapr.c @@ -10,7 +10,7 @@ #include "qemu-common.h" -#define PAGE_SIZE 4096 +#define SPAPR_PAGE_SIZE 4096 /* Memory must be a multiple of 256 MB, * so we have at least 256MB @@ -19,5 +19,5 @@ void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags) { - alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE); + alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, SPAPR_PAGE_SIZE); } |