virtio: move VirtQueueElement at the beginning of the structs
commit6aa46d8ff1ee7e9ca0c4a54d75c74108bee22124
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 31 Jan 2016 10:28:57 +0000 (31 11:28 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 4 Feb 2016 17:53:02 +0000 (4 19:53 +0200)
tree3b5a48e56168ec63101993e6af19ebeb1abea188
parent0734fb083cb0a91d17d355acdea16a3413b69b0c
virtio: move VirtQueueElement at the beginning of the structs

The next patch will make virtqueue_pop/vring_pop allocate memory for
the VirtQueueElement. In some cases (blk, scsi, gpu) the device wants
to extend VirtQueueElement with device-specific fields and, until now,
the place of the VirtQueueElement within the containing struct didn't
matter. When allocating the entire block in virtqueue_pop/vring_pop,
however, the containing struct must basically be a "subclass" of
VirtQueueElement, with the VirtQueueElement as the first field. Make
that the case for blk and scsi; gpu is already doing it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/scsi/virtio-scsi.c
include/hw/virtio/virtio-blk.h
include/hw/virtio/virtio-scsi.h