aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShannon Zhao <shannon.zhao@linaro.org>2015-05-11 17:34:07 +0800
committerMichael S. Tsirkin <mst@redhat.com>2015-05-31 16:26:41 +0200
commitecfa60e37439c870d08a90a845b061a53aa26f74 (patch)
tree1b79949e7020f85a88122e806e2ea00847f470e2
parent39b87c7b9f8bf3618e0357699d29615e521264d8 (diff)
downloadqemu-ecfa60e37439c870d08a90a845b061a53aa26f74.zip
qemu-ecfa60e37439c870d08a90a845b061a53aa26f74.tar.gz
qemu-ecfa60e37439c870d08a90a845b061a53aa26f74.tar.bz2
hw/s390x/virtio-ccw: use alias property for virtio-balloon-ccw
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/s390x/virtio-ccw.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index c96101a..f5f327c 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -896,44 +896,17 @@ static void virtio_ccw_balloon_realize(VirtioCcwDevice *ccw_dev, Error **errp)
}
}
-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);
+
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
TYPE_VIRTIO_BALLOON);
- 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);
+ object_property_add_alias(obj, "guest-stats", OBJECT(&dev->vdev),
+ "guest-stats", &error_abort);
+ object_property_add_alias(obj, "guest-stats-polling-interval",
+ OBJECT(&dev->vdev),
+ "guest-stats-polling-interval", &error_abort);
}
static void virtio_ccw_scsi_realize(VirtioCcwDevice *ccw_dev, Error **errp)