]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-serial: fix virtio-serial child refcount in transports
authorGonglei <arei.gonglei@huawei.com>
Tue, 30 Sep 2014 06:10:32 +0000 (14:10 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Jan 2015 22:02:35 +0000 (16:02 -0600)
commit8c64b47eeb6488d579bfed311269e5b35960308b
treebfcb19b7ab50e6ac5cfbdb537751bd92bcc58e57
parentaa383e9a8307325a8dc8569f13cf11d083c8b008
virtio-serial: fix virtio-serial 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-serial 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 e77ca8b92af8a5213897331d676089e8919f383d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/s390x/s390-virtio-bus.c
hw/s390x/virtio-ccw.c
hw/virtio/virtio-pci.c