virtio: make virtio device's structures public.

These structures must be made public to avoid two memory allocations for
refactored virtio devices.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
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 <aliguori@us.ibm.com>
This commit is contained in:
KONRAD Frederic 2013-03-18 17:37:18 +01:00 committed by Anthony Liguori
parent e531761d63
commit f1b24e840f
12 changed files with 159 additions and 160 deletions

View file

@ -17,31 +17,11 @@
#include "hw/block-common.h"
#include "sysemu/blockdev.h"
#include "hw/virtio-blk.h"
#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
#include "dataplane/virtio-blk.h"
#endif
#include "hw/scsi-defs.h"
#ifdef __linux__
# include <scsi/sg.h>
#endif
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;
static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
{
return (VirtIOBlock *)vdev;