diff options
Diffstat (limited to 'hw/s390x/virtio-ccw.c')
-rw-r--r-- | hw/s390x/virtio-ccw.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 9f2289db41..666df780d1 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -624,11 +624,45 @@ static int virtio_ccw_balloon_init(VirtioCcwDevice *ccw_dev) return virtio_ccw_device_init(ccw_dev, VIRTIO_DEVICE(vdev)); } +static void balloon_ccw_stats_get_all(Object *obj, struct Visitor *v, + void *opaque, const char *name, + Error **errp) +{ + VirtIOBalloonCcw *dev = opaque; + object_property_get(OBJECT(&dev->vdev), v, "guest-stats", errp); +} + +static void balloon_ccw_stats_get_poll_interval(Object *obj, struct Visitor *v, + void *opaque, const char *name, + Error **errp) +{ + VirtIOBalloonCcw *dev = opaque; + object_property_get(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", + errp); +} + +static void balloon_ccw_stats_set_poll_interval(Object *obj, struct Visitor *v, + void *opaque, const char *name, + Error **errp) +{ + VirtIOBalloonCcw *dev = opaque; + object_property_set(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", + errp); +} + static void virtio_ccw_balloon_instance_init(Object *obj) { VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj); object_initialize(OBJECT(&dev->vdev), TYPE_VIRTIO_BALLOON); object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL); + + object_property_add(obj, "guest-stats", "guest statistics", + balloon_ccw_stats_get_all, NULL, NULL, dev, NULL); + + object_property_add(obj, "guest-stats-polling-interval", "int", + balloon_ccw_stats_get_poll_interval, + balloon_ccw_stats_set_poll_interval, + NULL, dev, NULL); } static int virtio_ccw_scsi_init(VirtioCcwDevice *ccw_dev) |