Revision 07b0403d

b/hw/virtio-balloon.c
29 29
#include <sys/mman.h>
30 30
#endif
31 31

  
32
/* Disable guest-provided stats by now (https://bugzilla.redhat.com/show_bug.cgi?id=623903) */
33
#define ENABLE_GUEST_STATS   0
34

  
35

  
32 36
typedef struct VirtIOBalloon
33 37
{
34 38
    VirtIODevice vdev;
......
83 87
                                  VIRTIO_BALLOON_PFN_SHIFT);
84 88

  
85 89
    stat_put(dict, "actual", actual);
90
#if ENABLE_GUEST_STATS
86 91
    stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);
87 92
    stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);
88 93
    stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);
89 94
    stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);
90 95
    stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);
91 96
    stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);
97
#endif
92 98

  
93 99
    return QOBJECT(dict);
94 100
}
......
214 220
        }
215 221
        dev->stats_callback = cb;
216 222
        dev->stats_opaque_callback_data = cb_data; 
217
        if (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ)) {
223
        if (ENABLE_GUEST_STATS && (dev->vdev.guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ))) {
218 224
            virtqueue_push(dev->svq, &dev->stats_vq_elem, dev->stats_vq_offset);
219 225
            virtio_notify(&dev->vdev, dev->svq);
220 226
        } else {

Also available in: Unified diff