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-balloon.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hw/virtio-balloon.h') diff --git a/hw/virtio-balloon.h b/hw/virtio-balloon.h index f37f31b4d7..b0070421ca 100644 --- a/hw/virtio-balloon.h +++ b/hw/virtio-balloon.h @@ -52,4 +52,18 @@ typedef struct VirtIOBalloonStat { uint64_t val; } QEMU_PACKED VirtIOBalloonStat; +typedef struct VirtIOBalloon { + VirtIODevice vdev; + VirtQueue *ivq, *dvq, *svq; + uint32_t num_pages; + uint32_t actual; + uint64_t stats[VIRTIO_BALLOON_S_NR]; + VirtQueueElement stats_vq_elem; + size_t stats_vq_offset; + QEMUTimer *stats_timer; + int64_t stats_last_update; + int64_t stats_poll_interval; + DeviceState *qdev; +} VirtIOBalloon; + #endif -- cgit v1.2.3