]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports
authorGonglei <arei.gonglei@huawei.com>
Tue, 30 Sep 2014 06:10:30 +0000 (14:10 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Jan 2015 22:02:13 +0000 (16:02 -0600)
commitf06c87b11937ec797b59485d16c937538a82d7a8
tree5e923d9bced439124acfe7845a6a3bd2c9d52e69
parenteb5388e2609e6e99352e8d9909f13f60d9d34fd0
virtio/vhost-scsi: fix virtio-scsi/vhost-scsi 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-scsi/vhost-scsi 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 1312f12bcc8911ed99b67227fb9d1607295f71ed)
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