From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt37-0000y0-0c for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYt2z-0003XS-BQ for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:44:44 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:54699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt2z-0003Wm-1Y for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:44:37 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Sep 2014 09:44:31 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 98CEB17D8056 for ; Tue, 30 Sep 2014 09:46:39 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8U8iTFn59441168 for ; Tue, 30 Sep 2014 08:44:29 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8U8iTWU031933 for ; Tue, 30 Sep 2014 02:44:29 -0600 Date: Tue, 30 Sep 2014 10:44:23 +0200 From: Cornelia Huck Message-ID: <20140930104423.43ec7c46.cornelia.huck@de.ibm.com> In-Reply-To: <1412057438-10004-5-git-send-email-arei.gonglei@huawei.com> References: <1412057438-10004-1-git-send-email-arei.gonglei@huawei.com> <1412057438-10004-5-git-send-email-arei.gonglei@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 04/12] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: weidong.huang@huawei.com, mst@redhat.com, armbru@redhat.com, luonengjun@huawei.com, agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, stefanha@redhat.com, pbonzini@redhat.com, peter.huangpeng@huawei.com, rth@twiddle.net On Tue, 30 Sep 2014 14:10:30 +0800 wrote: > From: Gonglei > > 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 > --- > hw/s390x/s390-virtio-bus.c | 2 ++ > hw/s390x/virtio-ccw.c | 2 ++ > hw/virtio/virtio-pci.c | 2 ++ > 3 files changed, 6 insertions(+) Reviewed-by: Cornelia Huck