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>
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 5dd380e..9f07e6f 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -162,7 +162,7 @@
     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 @@
     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 @@
 
     /* 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);