dataplane: do not free VirtQueueElement in vring_push()
commitabd764250fbce6f285513d74f03eb5c526e520f6
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 9 Jul 2014 08:05:47 +0000 (9 10:05 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:20 +0000 (14 12:03 +0200)
treef782045c780ae30049bef65a2e0c819ceaf8aaa1
parent0a21ea3289c5a3b982386e3eaaa37627c18f5e35
dataplane: do not free VirtQueueElement in vring_push()

VirtQueueElement is allocated in vring_pop() so it seems to make sense
that vring_push() should free it.  Alas, virtio-blk frees
VirtQueueElement itself in virtio_blk_free_request().

This patch solves a double-free assertion in glib's g_slice_free().

Rename vring_free_element() to vring_unmap_element() since it no longer
frees the VirtQueueElement.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/virtio/dataplane/vring.c
include/hw/virtio/dataplane/vring.h