On 26/05/20 08:27, Markus Armbruster wrote:
>> It cannot happen, because a device must be unparented before it's
>> destroyed and unparenting takes care of unrealizing the device.
> 
> I can't see where unparenting takes care of unrealizing.  Can you help
> me?

Hidden in plain sight:

static void device_unparent(Object *obj)
{
    DeviceState *dev = DEVICE(obj);
    BusState *bus;

    if (dev->realized) {
        object_property_set_bool(obj, false, "realized", NULL);
    }
    ...
}

and the call stack is object_unparent -> object_property_del_child ->
object_finalize_child_property (via prop->release) -> class->unparent.

Thanks,

Paolo


Reply via email to