qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()
Date: Mon, 21 Dec 2015 16:49:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


On 20/12/2015 12:38, Cao jin wrote:
>>>
>>> +    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?

qdev_init_nofail adds them (qdev_init_nofail -> object_property_set_bool
-> device_set_realized -> object_property_add_child).

If you haven't reached qdev_init_nofail, you should indeed unref ds and
bds instead.  However, the bus should be unparented because pci_bus_new
makes it a child of ds (pci_bus_new -> qbus_create -> qbus_realize ->
object_property_add_child).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]