aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-balloon.h
diff options
context:
space:
mode:
authorKONRAD Frederic <fred.konrad@greensocs.com>2013-03-18 17:37:18 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-18 13:08:39 -0500
commitf1b24e840f9f85a2bb3912e4507d887e7858219d (patch)
tree02f71b36d2e0b115ca68d7663f2d18b4c63f7276 /hw/virtio-balloon.h
parente531761d63b7f8fe6b6423fafb3616ebbff768aa (diff)
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>
Diffstat (limited to 'hw/virtio-balloon.h')
-rw-r--r--hw/virtio-balloon.h14
1 files changed, 14 insertions, 0 deletions
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