From: KONRAD Frederic <fred.kon...@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.kon...@greensocs.com> --- 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