diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-11-29 12:37:04 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-03-07 17:28:07 +0100 |
commit | eb5937bad691ed18a401079a0604aa11fea0ecdd (patch) | |
tree | a26310ca140c15230c51cceeebc538f7f55b7888 /tests/ahci-test.c | |
parent | 143e6db6fa4ecd2a85de740cc3754aeb86d1e802 (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/ahci-test.c')
-rw-r--r-- | tests/ahci-test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 5dd380e5ea..9f07e6f2ce 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -162,7 +162,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) s = g_new0(AHCIQState, 1); s->parent = qtest_pc_vboot(cli, ap); global_qtest = s->parent->qts; - alloc_set_flags(s->parent->alloc, ALLOC_LEAK_ASSERT); + alloc_set_flags(&s->parent->alloc, ALLOC_LEAK_ASSERT); /* Verify that we have an AHCI device present. */ s->dev = get_ahci_device(s->parent->qts, &s->fingerprint); @@ -1039,7 +1039,7 @@ static void test_dma_fragmented(void) generate_pattern(tx, bufsize, AHCI_SECTOR_SIZE); /* Create a DMA buffer in guest memory, and write our pattern to it. */ - ptr = guest_alloc(ahci->parent->alloc, bufsize); + ptr = guest_alloc(&ahci->parent->alloc, bufsize); g_assert(ptr); bufwrite(ptr, tx, bufsize); @@ -1059,7 +1059,7 @@ static void test_dma_fragmented(void) /* Read back the guest's receive buffer into local memory */ bufread(ptr, rx, bufsize); - guest_free(ahci->parent->alloc, ptr); + guest_free(&ahci->parent->alloc, ptr); g_assert_cmphex(memcmp(tx, rx, bufsize), ==, 0); |