qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 32/61] virtio-balloon : show the VirtIOBalloon struc


From: fred . konrad
Subject: [Qemu-devel] [PATCH 32/61] virtio-balloon : show the VirtIOBalloon structure.
Date: Mon, 7 Jan 2013 19:40:45 +0100

From: KONRAD Frederic <address@hidden>

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 <address@hidden>
---
 hw/virtio-balloon.c | 12 ------------
 hw/virtio-balloon.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 12 deletions(-)

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
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]