From f1b24e840f9f85a2bb3912e4507d887e7858219d Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Mon, 18 Mar 2013 17:37:18 +0100 Subject: virtio: make virtio device's structures public. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These structures must be made public to avoid two memory allocations for refactored virtio devices. Signed-off-by: KONRAD Frederic Reviewed-by: Andreas Färber Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber Message-id: 1363624648-16906-2-git-send-email-fred.konrad@greensocs.com Changes V4 <- V3: * Rebased on current git. Changes V3 <- V2: * Style correction spotted by Andreas (virtio-scsi.h). * Style correction for virtio-net.h. Changes V2 <- V1: * Move the dataplane include into the header (virtio-blk). Signed-off-by: Anthony Liguori --- hw/virtio-blk.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'hw/virtio-blk.h') diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h index 7ef2f35852..19ec569bdd 100644 --- a/hw/virtio-blk.h +++ b/hw/virtio-blk.h @@ -16,6 +16,9 @@ #include "hw/virtio.h" #include "hw/block-common.h" +#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE +#include "dataplane/virtio-blk.h" +#endif /* from Linux's linux/virtio_blk.h */ @@ -108,6 +111,22 @@ struct VirtIOBlkConf uint32_t data_plane; }; +typedef struct VirtIOBlock { + VirtIODevice vdev; + BlockDriverState *bs; + VirtQueue *vq; + void *rq; + QEMUBH *bh; + BlockConf *conf; + VirtIOBlkConf *blk; + unsigned short sector_mask; + DeviceState *qdev; + VMChangeStateEntry *change; +#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE + VirtIOBlockDataPlane *dataplane; +#endif +} VirtIOBlock; + #define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \ DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) -- cgit v1.2.3