From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAxqB-0004Cn-ML for qemu-devel@nongnu.org; Mon, 21 Dec 2015 05:37:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAxq6-0008IC-NM for qemu-devel@nongnu.org; Mon, 21 Dec 2015 05:37:19 -0500 Received: from [59.151.112.132] (port=26832 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAxq6-0008I5-Br for qemu-devel@nongnu.org; Mon, 21 Dec 2015 05:37:14 -0500 References: <1450436632-23980-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1450436632-23980-4-git-send-email-caoj.fnst@cn.fujitsu.com> <56744A11.3030405@redhat.com> <56769336.9050104@cn.fujitsu.com> From: Cao jin Message-ID: <5677D6DA.40103@cn.fujitsu.com> Date: Mon, 21 Dec 2015 18:39:22 +0800 MIME-Version: 1.0 In-Reply-To: <56769336.9050104@cn.fujitsu.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: rth@twiddle.net, leon.alrae@imgtec.com, ehabkost@redhat.com, aurelien@aurel32.net, mst@redhat.com Hi Paolo On 12/20/2015 07:38 PM, Cao jin wrote: > Hi > > On 12/19/2015 02:01 AM, Paolo Bonzini wrote: >> >> >> On 18/12/2015 12:03, Cao jin wrote: > [...] >>> + >>> +err_register_bus: >>> + object_unref(OBJECT(ds)); >>> + object_unref(OBJECT(bds)); >>> + object_unref(OBJECT(bus)); >> >> I think these should be object_unparent, not unref. >> > > But, it seems these 3 objects isn`t added as a child-property via > object_property_add_child() during creation, so OBJECT(ds)->parent(so > does the other 2) will be NULL, and so object_unparent will do nothing? > > Or am I missing something? > I finally find what I missed...Yes you are right...In qom, seems all devices are attached to container:"peripheral", or "peripheral-anon", or "unattached" or anything I don`t see until now...Thanks a lot:) >> Paolo >> >>> } >>> >>> static void pxb_dev_exitfn(PCIDevice *pci_dev) >>> @@ -259,7 +263,7 @@ static void pxb_dev_class_init(ObjectClass >>> *klass, void *data) >>> DeviceClass *dc = DEVICE_CLASS(klass); >>> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); >>> >>> - k->init = pxb_dev_initfn; >>> + k->realize = pxb_dev_realize; >>> k->exit = pxb_dev_exitfn; >>> k->vendor_id = PCI_VENDOR_ID_REDHAT; >>> k->device_id = PCI_DEVICE_ID_REDHAT_PXB; >>> >> >> >> . >> > -- Yours Sincerely, Cao Jin