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/virtio-9p-test.c | |
parent | 143e6db6fa4ecd2a85de740cc3754aeb86d1e802 (diff) | |
download | qemu-eb5937bad691ed18a401079a0604aa11fea0ecdd.zip qemu-eb5937bad691ed18a401079a0604aa11fea0ecdd.tar.gz qemu-eb5937bad691ed18a401079a0604aa11fea0ecdd.tar.bz2 |
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/virtio-9p-test.c')
-rw-r--r-- | tests/virtio-9p-test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c index d275c74..8fd74f6 100644 --- a/tests/virtio-9p-test.c +++ b/tests/virtio-9p-test.c @@ -67,7 +67,7 @@ static QVirtIO9P *qvirtio_9p_pci_start(void) qvirtio_pci_device_enable(dev); qvirtio_start_device(v9p->dev); - v9p->vq = qvirtqueue_setup(v9p->dev, v9p->qs->alloc, 0); + v9p->vq = qvirtqueue_setup(v9p->dev, &v9p->qs->alloc, 0); qvirtio_set_driver_ok(v9p->dev); @@ -76,7 +76,7 @@ static QVirtIO9P *qvirtio_9p_pci_start(void) static void qvirtio_9p_pci_stop(QVirtIO9P *v9p) { - qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->qs->alloc); + qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, &v9p->qs->alloc); qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev)); qvirtio_pci_device_free((QVirtioPCIDevice *)v9p->dev); qvirtio_9p_stop(v9p); @@ -222,7 +222,7 @@ static P9Req *v9fs_req_init(QVirtIO9P *v9p, uint32_t size, uint8_t id, req->v9p = v9p; req->t_size = total_size; - req->t_msg = guest_alloc(v9p->qs->alloc, req->t_size); + req->t_msg = guest_alloc(&v9p->qs->alloc, req->t_size); v9fs_memwrite(req, &hdr, 7); req->tag = tag; return req; @@ -232,7 +232,7 @@ static void v9fs_req_send(P9Req *req) { QVirtIO9P *v9p = req->v9p; - req->r_msg = guest_alloc(v9p->qs->alloc, P9_MAX_SIZE); + req->r_msg = guest_alloc(&v9p->qs->alloc, P9_MAX_SIZE); req->free_head = qvirtqueue_add(v9p->vq, req->t_msg, req->t_size, false, true); qvirtqueue_add(v9p->vq, req->r_msg, P9_MAX_SIZE, true, false); @@ -290,8 +290,8 @@ static void v9fs_req_free(P9Req *req) { QVirtIO9P *v9p = req->v9p; - guest_free(v9p->qs->alloc, req->t_msg); - guest_free(v9p->qs->alloc, req->r_msg); + guest_free(&v9p->qs->alloc, req->t_msg); + guest_free(&v9p->qs->alloc, req->r_msg); g_free(req); } |