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>
This commit is contained in:
parent
39b87c7b9f
commit
ecfa60e374
|
@ -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)
|
static void virtio_ccw_balloon_instance_init(Object *obj)
|
||||||
{
|
{
|
||||||
VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj);
|
VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj);
|
||||||
|
|
||||||
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
|
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
|
||||||
TYPE_VIRTIO_BALLOON);
|
TYPE_VIRTIO_BALLOON);
|
||||||
object_property_add(obj, "guest-stats", "guest statistics",
|
object_property_add_alias(obj, "guest-stats", OBJECT(&dev->vdev),
|
||||||
balloon_ccw_stats_get_all, NULL, NULL, dev, NULL);
|
"guest-stats", &error_abort);
|
||||||
|
object_property_add_alias(obj, "guest-stats-polling-interval",
|
||||||
object_property_add(obj, "guest-stats-polling-interval", "int",
|
OBJECT(&dev->vdev),
|
||||||
balloon_ccw_stats_get_poll_interval,
|
"guest-stats-polling-interval", &error_abort);
|
||||||
balloon_ccw_stats_set_poll_interval,
|
|
||||||
NULL, dev, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_ccw_scsi_realize(VirtioCcwDevice *ccw_dev, Error **errp)
|
static void virtio_ccw_scsi_realize(VirtioCcwDevice *ccw_dev, Error **errp)
|
||||||
|
|
Loading…
Reference in a new issue