virtio-blk: embed VirtQueueElement in VirtIOBlockReq
commitf897bf751fbd95e4015b95d202c706548586813a
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 9 Jul 2014 08:05:49 +0000 (9 10:05 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Jul 2014 10:03:20 +0000 (14 12:03 +0200)
tree38023ac92b901f2cd4c7aa45b34549a08cfba9ca
parent869d66af53d8e04709456c9cae5cca7c560d4b93
virtio-blk: embed VirtQueueElement in VirtIOBlockReq

The memory allocation between hw/block/virtio-blk.c,
hw/block/dataplane/virtio-blk.c, and hw/virtio/dataplane/vring.c is
messy.  Structs are allocated in different files than they are freed in.
This is risky and makes memory leaks easier.

Embed VirtQueueElement in VirtIOBlockReq to reduce the amount of memory
allocation we need to juggle.  This also makes vring.c and virtio.c
slightly more similar.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/dataplane/virtio-blk.c
hw/block/virtio-blk.c
hw/virtio/dataplane/vring.c
include/hw/virtio/dataplane/vring.h
include/hw/virtio/virtio-blk.h