]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio: fix virtio-blk child refcount in transports
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 18 Jun 2014 09:58:35 +0000 (17:58 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Jul 2014 07:15:02 +0000 (09:15 +0200)
commitc5d49db4469dfc0cc7f4c01dfb4ed4e8b96bdbcd
tree0dd5ea735cdd76d91fa4ddf8c3921cac360eb924
parentf7fedda84a8eb316c99a9de647c4844b862a7b38
virtio: fix virtio-blk 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-blk child is not finalized!

Drop our reference after the child property has been added to the
parent.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
hw/s390x/s390-virtio-bus.c
hw/s390x/virtio-ccw.c
hw/virtio/virtio-pci.c