]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-balloon: fix virtio-balloon child refcount in transports
authorGonglei <arei.gonglei@huawei.com>
Tue, 30 Sep 2014 06:10:35 +0000 (14:10 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Jan 2015 22:03:19 +0000 (16:03 -0600)
commit20dc758b7f350f67449dbcfe61584005d87ac4da
tree3589916874bff5cd32183ffa10d70194f9602d83
parent0077793a00a7ff4e44d6bdfe3469b61ba14962ec
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 <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 91ba21208839643603e7f7fa5864723c3f371ebe)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/s390x/virtio-ccw.c
hw/virtio/virtio-pci.c