aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/malloc-spapr.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-11-29 12:37:04 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 17:28:07 +0100
commiteb5937bad691ed18a401079a0604aa11fea0ecdd (patch)
treea26310ca140c15230c51cceeebc538f7f55b7888 /tests/libqos/malloc-spapr.c
parent143e6db6fa4ecd2a85de740cc3754aeb86d1e802 (diff)
tests/libqos: embed allocators instead of malloc-ing them separately
qgraph will embed these objects instead of allocating them in a separate object. Expose a new API "generic_alloc_init" and "generic_alloc_destroy" for that, and rename the existing API with s/init/new/ and s/uninit/free/. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/malloc-spapr.c')
-rw-r--r--tests/libqos/malloc-spapr.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/tests/libqos/malloc-spapr.c b/tests/libqos/malloc-spapr.c
index 1c359cea6c..2a6b7e3776 100644
--- a/tests/libqos/malloc-spapr.c
+++ b/tests/libqos/malloc-spapr.c
@@ -17,22 +17,7 @@
*/
#define SPAPR_MIN_SIZE 0x10000000
-void spapr_alloc_uninit(QGuestAllocator *allocator)
+void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
{
- alloc_uninit(allocator);
-}
-
-QGuestAllocator *spapr_alloc_init_flags(QTestState *qts, QAllocOpts flags)
-{
- QGuestAllocator *s;
-
- s = alloc_init_flags(flags, 1 << 20, SPAPR_MIN_SIZE);
- alloc_set_page_size(s, PAGE_SIZE);
-
- return s;
-}
-
-QGuestAllocator *spapr_alloc_init(void)
-{
- return spapr_alloc_init_flags(NULL, ALLOC_NO_FLAGS);
+ alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE);
}