Patchwork [32/61] virtio-balloon : show the VirtIOBalloon structure.

login
register
mail settings
Submitter fred.konrad@greensocs.com
Date Jan. 7, 2013, 6:40 p.m.
Message ID <1357584074-10852-33-git-send-email-fred.konrad@greensocs.com>
Download mbox | patch
Permalink /patch/210075/
State New
Headers show

Comments

fred.konrad@greensocs.com - Jan. 7, 2013, 6:40 p.m.
From: KONRAD Frederic <fred.konrad@greensocs.com>

As we discuss with anthony and andreas, this structure must be showed to avoid
two memory allocations for virtio-balloon-x.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 hw/virtio-balloon.c | 12 ------------
 hw/virtio-balloon.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 12 deletions(-)

Patch

diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 3040bc6..3ea1790 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -27,18 +27,6 @@ 
 #include <sys/mman.h>
 #endif
 
-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;
-    DeviceState *qdev;
-} VirtIOBalloon;
-
 static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
 {
     return (VirtIOBalloon *)vdev;
diff --git a/hw/virtio-balloon.h b/hw/virtio-balloon.h
index b1828f4..0cd211e 100644
--- a/hw/virtio-balloon.h
+++ b/hw/virtio-balloon.h
@@ -52,4 +52,15 @@  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;
+    DeviceState *qdev;
+} VirtIOBalloon;
+
 #endif