From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt6M-00052Q-P1 for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYt6E-0004Oc-Sk for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:48:06 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:52135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYt6E-0004O7-JD for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:47:58 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Sep 2014 09:47:52 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id C99F917D804E for ; Tue, 30 Sep 2014 09:49:59 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8U8looV54132986 for ; Tue, 30 Sep 2014 08:47:50 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8U8lnXA003341 for ; Tue, 30 Sep 2014 02:47:49 -0600 Date: Tue, 30 Sep 2014 10:47:43 +0200 From: Cornelia Huck Message-ID: <20140930104743.497c6a90.cornelia.huck@de.ibm.com> In-Reply-To: <1412057438-10004-7-git-send-email-arei.gonglei@huawei.com> References: <1412057438-10004-1-git-send-email-arei.gonglei@huawei.com> <1412057438-10004-7-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 06/12] virtio-serial: fix virtio-serial 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:32 +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-serial 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 | 1 + > hw/s390x/virtio-ccw.c | 1 + > hw/virtio/virtio-pci.c | 1 + > 3 files changed, 3 insertions(+) Reviewed-by: Cornelia Huck