From 91ba21208839643603e7f7fa5864723c3f371ebe Mon Sep 17 00:00:00 2001 From: Gonglei Date: Tue, 30 Sep 2014 14:10:35 +0800 Subject: virtio-balloon: fix virtio-balloon child refcount in transports object_initialize() leaves the object with a refcount of 1. object_property_add_child() adds its own reference which is dropped again when the property is deleted. The upshot of this is that we always have a refcount >= 1. Upon hot unplug the virtio-balloon child is not finalized! Drop our reference after the child property has been added to the parent. Signed-off-by: Gonglei Reviewed-by: Cornelia Huck Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/s390x/virtio-ccw.c') diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index de0764de48..c074f64e92 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -900,7 +900,7 @@ static void virtio_ccw_balloon_instance_init(Object *obj) VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj); object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON); object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL); - + object_unref(OBJECT(&dev->vdev)); object_property_add(obj, "guest-stats", "guest statistics", balloon_ccw_stats_get_all, NULL, NULL, dev, NULL); -- cgit v1.2.3