From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAcHt-0005xr-JW for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:36:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAcHo-000600-Hb for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:36:29 -0500 Received: from [59.151.112.132] (port=25038 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAcHo-0005yH-6S for qemu-devel@nongnu.org; Sun, 20 Dec 2015 06:36:24 -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> From: Cao jin Message-ID: <56769336.9050104@cn.fujitsu.com> Date: Sun, 20 Dec 2015 19:38:30 +0800 MIME-Version: 1.0 In-Reply-To: <56744A11.3030405@redhat.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: mst@redhat.com, leon.alrae@imgtec.com, ehabkost@redhat.com, aurelien@aurel32.net, rth@twiddle.net 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? > 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