From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYszx-00073T-Ug for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:41:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYszp-0002jK-PC for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:41:29 -0400 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:53016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYszp-0002iL-IR for qemu-devel@nongnu.org; Tue, 30 Sep 2014 04:41:21 -0400 Received: by mail-wg0-f42.google.com with SMTP id z12so4087240wgg.13 for ; Tue, 30 Sep 2014 01:41:15 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <542A6CA7.6040108@redhat.com> Date: Tue, 30 Sep 2014 10:41:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1412057438-10004-1-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1412057438-10004-1-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 00/12] virtio: fix virtio child recount in transports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: agraf@suse.de, weidong.huang@huawei.com, mst@redhat.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, armbru@redhat.com, borntraeger@de.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, rth@twiddle.net Il 30/09/2014 08:10, arei.gonglei@huawei.com ha scritto: > From: Gonglei > > virtio-$device-{pci, s390, ccw} all duplicate the > qdev properties of their virtio child. This approach does > not work well with string or pointer properties since we > must be careful about leaking or double-freeing them. > > Use the QOM alias property to forward property accesses to the > VirtIORNG child. This way no duplication is necessary. > > For their child, 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-$device child is not finalized! > > Drop our reference after the child property has been added to the > parent. > > Changs since v1: > - add the same handling for virtio-9p-pci device in PATCH 10 and PATCH 11. > - add a wrapper function for better code sharing > in PATCH 12 (Cornelia/Michael/Paolo) I would like to take these patches through the SCSI tree, because of a small conflict with virtio-scsi dataplane. Any objections? Paolo